I5 · Machine Learning Foundations

Module Review and Assessment

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.

15 min Intermediate · Sublevel Intermediate Jump to the activity

What you need: The earlier topics of this module.

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

TopicKey idea
Types of learningSupervised (labels), unsupervised (no labels), self-supervised, reinforcement (rewards)
Workflow and splitsFrame, collect, explore, train, evaluate, deploy; train/validation/test; avoid leakage
FeaturesScale for distance and gradient methods; one-hot encode categories
RegressionLinear regression; MAE, RMSE, R²; compare with the mean
Classificationk-NN, trees, logistic regression, naive Bayes
EvaluationConfusion matrix; precision, recall, F1; thresholds
GeneralisationOverfitting vs underfitting; cross-validation; regularisation
Clustering and toolsk-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

Question 1

1. Grouping news articles by topic with no labels is…

Question 2

2. What is the purpose of the validation set?

Question 3

3. Which model does NOT need feature scaling?

Question 4

4. Model A and B have equal MAE, but B's RMSE is much higher. This means…

Question 5

5. A fraud model flags 240 transactions, 40 of them real fraud. Its precision is about…

Question 6

6. Which metric matters most for screening a serious disease?

Question 7

7. How does logistic regression produce a probability?

Question 8

8. k = 1 in k-NN tends to…

Question 9

9. Why put preprocessing inside a scikit-learn Pipeline?

Question 10

10. Training 98%, validation 72%. What should you try first?

Question 11

11. A degree-15 polynomial fits training data perfectly but fails on test data. Which fix helps most directly?

Question 12

12. What does a support vector machine try to maximise?

Question 13

13. How does a random forest differ from gradient boosting?

Question 14

14. A model has an ROC AUC of 0.5. What does that mean?

Question 15

15. Why must hyperparameters be tuned with cross-validation rather than on the test set?

Question 16

16. Which clustering method can find oddly shaped clusters and label noise points, without choosing k?

Question 17

17. What does a dendrogram show?

Question 18

18. The first principal component in PCA is…

Question 19

19. In market-basket analysis, a rule bread → butter has lift 2. This means…

Question 20

20. Isolation Forest flags anomalies because they…

Question 21

21. Why should time-series data not be split randomly into training and test sets?

Question 22

22. Collaborative filtering recommends items based on…

Question 23

23. In reinforcement learning, an agent learns from…

Question 24

24. A fraud dataset has 1% fraud. A model predicts "not fraud" for everything. Which statement is true?

Question 25

25. Which feature-engineering mistake causes data leakage?

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)