MegaMaester

Artificial Intelligence · Lesson 2

How Machines Learn from Data

beginner16 min · 13 cards
Start here

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.

Concept 1 of 10

Why this matters

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.

Concept 2 of 10

Core concepts

Data, features, and labels

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.

The model as a function

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.

Train, evaluate, deploy

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.

Concept 3 of 10

Worked example

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.

Concept 4 of 10

Counterexample

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.

Concept 5 of 10

Case study: the Netflix Prize

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.

Concept 6 of 10

Common misconceptions

  • "The model stores the examples it was trained on." — It generally stores a function fitted to them, not the examples themselves.
  • "A feature is just the raw data." — Features are the specific measured properties chosen from the data; choosing them well is much of the work.
  • "High accuracy on the training data means the model is good." — It may have merely memorised; only performance on unseen data counts.
  • "A cleverer algorithm always beats more data." — More representative, better-labelled data usually helps more than a fancier method.
Concept 7 of 10

Interactive challenge — Build the Training Set

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.

Concept 8 of 10

Knowledge check

  1. Define data, features, and labels, and explain how they differ.
  2. Why is it useful to think of a model as a function from inputs to outputs?
  3. Why must a model be evaluated on data it did not train on?
  4. Give a case where more data would not improve a model.
  5. What did the Netflix Prize suggest about clever algorithms versus working the data?
Concept 9 of 10

Lesson summary

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.

Quick check

What most clearly distinguishes machine learning from traditional rule-based programming?