AI Foundations / How AI Learns
What models actually learn from.
Reviewed by Yuvaraj
A machine learning model is only as good as what it learns from. Before any clever algorithm, there is data, and how you prepare that data usually matters more than which model you pick.
Two words you will see constantly:
Learning from labeled examples, features paired with the right answer, is called supervised learning, and it is the most common setup in practice.
A dataset is just a table: one row per example, one column per feature, plus the label column.
| sqft | rooms | neighborhood | price, USD (label) |
|---|---|---|---|
| 900 | 2 | East | 310,000 |
| 1500 | 3 | West | 455,000 |
The model never sees "a house." It sees a row of numbers and learns which columns move the label.
Models do not see the world; they see the numbers you give them. Choosing and shaping those numbers is called feature engineering, and it can make or break a model.
Answer from memory before revealing, retrieval practice is what builds durable recall.
In machine learning, a "feature" is:
Why hold out a separate test set instead of evaluating on the training data?
Ask about this lesson, or about anything in AI. Answers cite the lessons they draw on.
Finished this lesson?
Mark it complete to earn XP, keep your streak, and schedule a review.
Suppose two features: house size in square feet (around 1,000) and number of bedrooms (around 3). Many models measure "distance" between examples. The size feature, roughly 300× larger in magnitude, drowns out bedrooms entirely, the model effectively ignores a useful signal. Standardizing each feature to mean 0 and standard deviation 1 puts them on equal footing:
After scaling, a one-bedroom difference and a modest size difference carry comparable weight. Same data, same model, but a representation the model can actually use.
Garbage in, garbage out
A simple model trained on clean, representative data will usually beat a sophisticated model trained on messy, biased data. Time spent understanding and cleaning data is rarely wasted.
Two failure modes to watch for:
Real projects spend most of their time to the left of "train":
To measure generalization honestly, split the data:
| Split | Purpose |
|---|---|
| Training | The examples the model learns from |
| Validation | Tune choices (which model, which settings) without touching the test set |
| Test | A final, untouched check of real-world performance |
Never test on your training data
Evaluating a model on data it was trained on tells you almost nothing, it can simply recite what it saw. Split before you engineer features, too: computing a scaling factor or average over the whole dataset leaks test information into training. Keep the test set sealed until the very end.