What learning from data means.
Start with programs, examples, patterns, and the difference between learning and memorising.
Start with the meaning.
A computer program is a set of instructions. A traditional program might say: if a message contains a particular word, move it to a folder. The programmer wrote the rule directly. Machine learning begins when writing every useful rule by hand becomes impractical. Instead, we give a learning algorithm examples and let it choose a rule from a family of possible rules. That chosen rule is called a model. The model is still a program: it takes an input and produces an output. The difference is how some of its behavior was determined.
Imagine predicting whether a message is useful or unwanted. A human can label past messages. Each message is an example, and its label is the answer we want to predict. The learning process examines patterns in these examples, such as which words tend to appear with each label. Later, the model receives a new message whose answer is unknown and makes a prediction. This does not mean the machine understands language as a person does. It means its learned pattern can sometimes generalise to similar inputs.
How the idea works.
There are three parts to keep separate. The task is the question we want answered. The data is the recorded evidence available for learning. The model is the particular rule fitted from that evidence. A strong model cannot repair a badly defined task or labels that contradict the real goal. For example, if “useful” means “a message that my team answered,” historical labels may also encode which colleagues were on holiday. The model may learn that accident rather than a useful signal about message content.
Learning is not the same as memorisation. A memoriser can repeat answers for examples it has already seen but fail on a new one. The purpose of machine learning is to make useful predictions on future cases drawn from the intended setting. We call that ability generalisation. It is why evaluating a model only on its training examples is misleading. A model that stores every training row may have perfect training accuracy yet be useless when the next row differs slightly.
Different tasks call for different outputs. Classification chooses a category such as “useful” or “unwanted.” Regression predicts a quantity such as a delivery time. Clustering groups similar inputs without preassigned labels. A recommendation system may rank options. These are not interchangeable names for the same job: the output type determines how we represent data, choose a model, and judge success. The course will build these ideas one at a time, beginning with the simplest possible data and code.
Follow the code.
messages = ["meeting today", "claim your prize", "project update"]
labels = ["useful", "unwanted", "useful"]
for message, label in zip(messages, labels):
print(message, "->", label)This is ordinary Python, before any machine learning library. Square brackets make lists. The first list contains three text messages; the second contains three answers in the same order. zip pairs the first message with the first label, then the second with the second, and so on. The for loop visits each pair. print displays the relationship, which is the information a supervised learner would receive. No model is trained here: the point is to make the examples and answers visible before hiding them inside an API call.
The pairing depends on order. If the labels are shifted by one position, the program still runs but now teaches the wrong relationship. Real datasets often use a table so each row keeps its input and answer together. The labels also need a consistent meaning. “Useful” must be decided by an agreed rule, or two people may label the same message differently. Those human decisions become part of the system the model learns from.
What the result does not say.
A prediction is an estimate, not a fact. The model can be uncertain, and even a confident prediction can be wrong when the new case differs from its examples. Machine learning is most appropriate when a meaningful pattern exists in available data, the cost of mistakes is understood, and the result can be evaluated against the real task. Sometimes a clear rule written by a person is simpler and more reliable.
The phrase “artificial intelligence” covers a much wider set of ideas. This course focuses on learning from examples using Python. It explains the common concepts behind many algorithms, then shows the code that expresses those concepts. You do not need prior machine learning knowledge, and the next chapter explains the Python pieces used in the examples.
One clear idea.
A model is a rule learned from examples; its value lies in how well it handles new cases.
The ML cookbook
Complete, explained Python workflows sit alongside this reading course.