How Machines Learn from Data
How machines learn from data: features, labels, the model as an input-to-output function, and the train-evaluate-deploy loop, seen through the Netflix Prize.
Artificial Intelligence · Lesson 2
How machines learn from data: features, labels, the model as an input-to-output function, and the train-evaluate-deploy loop, seen through the Netflix Prize.
A machine learning system is only ever as good as what it learns from. Understand its raw materials — the data, the features that describe it, the labels it imitates — and you can predict where it will succeed and where it will quietly fail. This echoes a lesson from Statistics: a conclusion inherits every weakness of the evidence behind it. Better data usually helps more than a cleverer method.
Three ingredients turn examples into learning. Data is the collection of examples — emails, photos, customer records. Features are the measurable properties the model actually reads: the words in an email, a customer's age and purchase history. Labels are the known answers attached to training examples — "spam" or "not spam", the rating a viewer gave a film. The model's task is to learn that link well enough to guess the label when only the features are known.
At its core a model is a function: features go in, a prediction comes out. Training searches for the version of that function which turns the features you have into the labels you know with the fewest mistakes. What makes it more than arithmetic is that nobody writes the function by hand; the algorithm adjusts a great many internal settings until the mapping fits the examples. The same function is then applied to new inputs it never saw.
Learning follows a loop. First train the model on one portion of the data. Then evaluate it on a separate portion it never saw, because testing on the training examples measures memory, not learning. If it performs well on the held-back data, deploy it for inference and monitor it, since the world drifts and yesterday's patterns decay. Then improve: gather better data and train again.
Imagine predicting whether a customer will cancel next month. The features might be login frequency, days since their last visit, and support tickets opened. The label, drawn from history, is whether each past customer actually cancelled. You train a model to map features to label, hold back a slice of customers to test it honestly, then deploy it to flag current customers worth a retention offer. One genuinely predictive feature often helps more than a fancier algorithm.
More data is not automatically better data. A model trained on unrepresentative examples learns the wrong lesson confidently. If your cancellation records come only from one country during a price promotion, doubling that data merely entrenches a pattern that will not hold elsewhere. Mislabelled examples teach mistakes just as faithfully. Quantity helps only when the examples are representative and the labels accurate.
In 2006 Netflix launched an open competition offering one million dollars to any team that could improve its movie recommendation system by ten percent. It released a genuine dataset of roughly 100 million ratings from around 480,000 anonymised users across nearly 18,000 films — the ratings were labels, users and movies the features. Thousands of teams competed for three years, and the prize was won in 2009 by a team called BellKor's Pragmatic Chaos. A durable lesson emerged: the strongest entries were not single clever algorithms but blends of many models, and much of the gain came from engineering features out of the raw ratings. Netflix later chose not to deploy the full winning solution, judging its engineering cost too high.
Given a prediction goal, such as "will this loan be repaid", you assemble the pieces: pick which fields become features, identify the label, and set aside a fair test slice — then spot the flaw in a tempting but leaky feature that secretly encodes the answer already.
Think Like a Maester: Before admiring the algorithm, inspect the examples. A model can only learn the world its training data shows it, and most failures trace back to the data, not the maths.
Machine learning turns examples into predictions through three raw materials — data, features, and labels — fitted into a function that maps inputs to outputs. The work follows a loop: train on one portion of the data, evaluate honestly on another, deploy for inference, monitor as conditions drift, and improve with better examples. The Netflix Prize showed both the power of large real datasets and the recurring truth that representative data and careful feature work often matter more than algorithmic cleverness.
Mark this lesson complete to track your progress.