Definition
Could you now take a data set, choose a sensible model, validate it honestly and explain its results to someone who has never heard of machine learning?
This review brings together Machine Learning Foundations: what machine learning is, its vocabulary and types, the workflow, data splits and cross-validation, feature preparation, regression models and metrics, classifiers (k-NN, decision trees, logistic regression, naive Bayes), k-means clustering, evaluation with confusion matrices, precision and recall, overfitting, no-code tools and scikit-learn, followed by a scored quiz.
In simple words
Read the recap table, try the activities, then take the quiz. Each answer comes with an explanation. If you miss one, go back to that topic.
Why it matters
These foundations apply to every model you will meet later, including neural networks and large language models: the same questions about data, validation, metrics and generalisation always come back.
How it works
| Topic | Key idea |
|---|---|
| Types of learning | Supervised (labels), unsupervised (no labels), self-supervised, reinforcement (rewards) |
| Workflow and splits | Frame, collect, explore, train, evaluate, deploy; train/validation/test; avoid leakage |
| Features | Scale for distance and gradient methods; one-hot encode categories |
| Regression | Linear regression; MAE, RMSE, R²; compare with the mean |
| Classification | k-NN, trees, logistic regression, naive Bayes |
| Evaluation | Confusion matrix; precision, recall, F1; thresholds |
| Generalisation | Overfitting vs underfitting; cross-validation; regularisation |
| Clustering and tools | k-means; no-code tools; scikit-learn pipelines |
Try it yourself
Match the problem to the method
Which method fits best?
- Grouping customers with no labels
- Predicting a flat's price
- Fast spam filtering from word counts
- An explainable yes/no loan rule set
- A reliable estimate of model performance on small data
Overfitting or underfitting?
Diagnose each result.
A decision tree with no depth limit
Training 62%, validation 61%, both poor
A straight line fitted to a clear curve
Training accuracy 99%, validation 70%
Common mistakes
- Judging models by accuracy alone on imbalanced data.
- Tuning on the test set.
- Skipping scaling for distance-based models.
Check yourself
Summary
- Frame the task, split data honestly and always compare with a baseline.
- Choose models and metrics that fit the problem and the real cost of errors.
- Diagnose over- and underfitting with validation, and use pipelines to avoid leakage.
Finished reading?
Sources: scikit-learn User Guide · An Introduction to Statistical Learning (James, Witten, Hastie, Tibshirani)