Machine Learning Fundamentals — Fundamentals
What ML Actually Is
One-line idea: Machine learning is a program learning its own rule from labeled examples, instead of a person writing that rule by hand.
Everyday comparison: A traditional spam filter might be hand-coded rules ("block if it contains 'FREE MONEY'"). A machine-learned spam filter is shown thousands of emails already labeled spam or not-spam, and works out its own pattern of what makes an email spam — a pattern a person never had to write down explicitly.
Common mistake + fix: Assuming ML is needed for every prediction problem. Fix: if a simple hand-written rule already works well and the pattern isn't likely to change, a plain rule is often more reliable and far easier to debug than a trained model — ML earns its complexity when the pattern is too subtle or too large to hand-code.
Memory line: ML learns the rule from data. A traditional program is handed the rule. Use ML when the rule is genuinely too complex to write by hand.
Supervised vs. Unsupervised Learning
One-line idea: Supervised learning learns from examples that already have the right answer attached; unsupervised learning finds structure in data that has no "right answer" labeled at all.
Everyday comparison: Supervised learning is like a student studying from a textbook with the answer key included — they learn by comparing their guess to the known correct answer. Unsupervised learning is like being handed a box of mixed photos with no captions and asked to sort them into sensible piles — there's no "correct" grouping to check against, just a useful one.
Common mistake + fix: Calling every ML technique "supervised" by default. Fix: check whether your training data actually has a labeled correct answer for each example — if not, you're in unsupervised territory, and accuracy-style metrics (see Advanced) don't apply the same way.
Memory line: Supervised learning has an answer key. Unsupervised learning doesn't — it finds structure, not a "correct" answer.
Features and Labels
One-line idea: Features are the inputs a model learns from; the label is the answer it's trying to predict.
Everyday comparison: Predicting a cricket team's win chance from their recent batting average, bowling economy, and home-ground advantage — those three numbers are the features; "won or lost" is the label.
Common mistake + fix: Including a feature that's actually a disguised version of the label itself (e.g. "final score difference" when predicting "won or lost" — of course a positive score difference means a win). Fix: for every feature, ask "would I actually know this before the outcome happens?" — if not, it doesn't belong as an input. This is the seed of data leakage, covered properly in Intermediate.
Memory line: Features are what you know going in. The label is what you're trying to predict. A feature that already contains the answer isn't a real feature.
Train/Test Split
One-line idea: You never evaluate a model on the same data it learned from — you hold back a separate "test" portion the model never sees during training, and grade it on that instead.
Everyday comparison: Grading a student only on questions identical to ones from their practice sheets tells you how well they memorised those specific questions — not whether they actually understand the subject. A real exam uses new questions on the same topics, which is exactly what a test set does for a model.
Common mistake + fix: Checking a model's accuracy on the same rows it was trained on, and reporting that number as "performance." Fix: always report performance on a held-out test set the model never saw during training — training-set accuracy alone tells you almost nothing about how it'll do on new data.
Memory line: Never grade a model's homework with its own answer key. Always test on data it hasn't seen.
Baseline Model First
One-line idea: Before building anything sophisticated, build the dumbest reasonable model first — it tells you what "good" actually means for this specific problem.
Everyday comparison: Before praising a weather forecaster's accuracy, check what you'd get just by always guessing "tomorrow will be like today" — if that naive guess is already right 85% of the time, a forecaster who's right 86% of the time hasn't actually achieved much.
Common mistake + fix: Reporting a model's accuracy (say, 92%) as impressive without checking what a trivial baseline (always guessing the most common class) would score. Fix: always compute and report the baseline first — a real model's value is how much it beats the baseline by, not its raw score alone.
Memory line: A model's score means nothing on its own. It only means something compared to the dumbest reasonable baseline.
Overfitting vs. Underfitting
One-line idea: An overfit model has memorised the training examples instead of learning the actual pattern; an underfit model hasn't learned enough of the pattern at all — both fail on new data, for opposite reasons.
Everyday comparison: A student who memorises last year's exact exam paper (every question, every answer) will ace that specific paper but fail a new one testing the same topics differently — that's overfitting. A student who barely studied and doesn't understand the topic at all will do badly on both papers — that's underfitting. The goal is a student who actually understands the subject, which performs well on both.
Common mistake + fix: Chasing ever-higher training accuracy without checking the test-set gap. Fix: always compare training and test performance side by side — a growing gap between them, as you make the model more complex, is the signal to stop adding complexity (or add regularization, covered in Intermediate).
Memory line: Overfitting memorises the practice questions. Underfitting never learned the subject. Watch the train-test gap, not just the training score.

