Intermediate · module I5
Machine Learning Foundations
By the end: Frame a problem as regression, classification or clustering, train and evaluate a model, and diagnose overfitting
- Covers
- The machine learning workflow and the core algorithms, trained and evaluated with scikit-learn and no-code tools
- Contents
- 7 chapters, 21 topics
- Time
- About 4 hours
- Level
- Intermediate
- Your progress
- 0 / 21
This module builds on Working with Data: NumPy, pandas, SQL and Visualisation, Mathematics for AI. We suggest looking at it first, but the choice is yours.
Chapter 1 Foundations
- 1.112 min Read Activity
What Is Machine Learning?
A precise definition, and how it differs from ordinary programming
Interactive: build a spam detector
- 1.28 min Read
Machine Learning Terminology
Features, labels, samples, models, parameters, training and inference
Interactive: label the parts of a dataset
- 1.310 min Read Activity
Types of Machine Learning
Supervised, unsupervised, semi-supervised, self-supervised and reinforcement learning
Card sort: which type fits?
- 1.48 min Read
The Machine Learning Workflow
From problem to data to model to evaluation to deployment
Interactive: order the workflow
Chapter 2 Preparing Data
- 2.110 min Read Activity
Training, Validation and Test Sets
Why data is split, and how to split it fairly
Code: train_test_split with stratification
- 2.210 min Activity
Feature Scaling and Encoding
Standardisation, normalisation and one-hot encoding
Code: prepare a mixed dataset
x′ = (x − μ) / σ
Chapter 3 Regression
- 3.112 min Read Activity
Linear Regression
Fitting a straight line to predict a number
Interactive: drag the line, then fit it in code
ŷ = wx + b
- 3.28 minBeing written
Measuring Regression Error
MAE, MSE and RMSE
Code: compare two models
MSE = Σ(y − ŷ)² / n
Chapter 4 Classification
- 4.110 minBeing written
k-Nearest Neighbours
Classifying by the most similar examples
Interactive: move a point and watch the vote
- 4.212 min Read
- 4.310 min Read
Logistic Regression
Predicting a probability for a yes-or-no answer
Code: predict pass or fail
P = 1 / (1 + e^−z)
- 4.410 minBeing written
Naive Bayes
Classifying text with probabilities
Code: classify messages
Chapter 5 Clustering
- 5.112 min Activity
Chapter 6 Evaluating Models
- 6.110 min Read
Accuracy and the Confusion Matrix
True and false positives and negatives
Code: build a confusion matrix
- 6.212 min Read
Precision, Recall and F1 Score
Choosing the right metric for the cost of each error
Code: compare metrics on imbalanced data
F1 = 2PR / (P + R)
- 6.310 min Read
Overfitting and Underfitting
Memorising compared with generalising, and how to spot each
Interactive: tree depth and test score
- 6.48 minBeing written
Cross-Validation
A fairer estimate using several splits
Code: five-fold cross-validation
Chapter 7 Tools and Practice
- 7.115 minBeing written
No-Code Machine Learning
Building and comparing models visually with a data-mining tool
Lab: classify the Iris dataset without code
- 7.212 min Activity
- 7.325 minBeing written
Project: Predict House Prices
An end-to-end regression project
Project notebook
- 7.415 minBeing written
Module Review and Assessment
Coding exercises and a scored quiz
Graded project checkpoints