All courses

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. 1.1

    What Is Machine Learning?

    A precise definition, and how it differs from ordinary programming

    Interactive: build a spam detector

    12 min Read Activity
  2. 1.2

    Machine Learning Terminology

    Features, labels, samples, models, parameters, training and inference

    Interactive: label the parts of a dataset

    8 min Read
  3. 1.3

    Types of Machine Learning

    Supervised, unsupervised, semi-supervised, self-supervised and reinforcement learning

    Card sort: which type fits?

    10 min Read Activity
  4. 1.4

    The Machine Learning Workflow

    From problem to data to model to evaluation to deployment

    Interactive: order the workflow

    8 min Read

Chapter 2 Preparing Data

  1. 2.1

    Training, Validation and Test Sets

    Why data is split, and how to split it fairly

    Code: train_test_split with stratification

    10 min Read Activity
  2. 2.2

    Feature Scaling and Encoding

    Standardisation, normalisation and one-hot encoding

    Code: prepare a mixed dataset

    x′ = (x − μ) / σ

    10 min Activity

Chapter 3 Regression

  1. 3.1

    Linear Regression

    Fitting a straight line to predict a number

    Interactive: drag the line, then fit it in code

    ŷ = wx + b

    12 min Read Activity
  2. 3.2

    Measuring Regression Error

    MAE, MSE and RMSE

    Code: compare two models

    MSE = Σ(y − ŷ)² / n

    8 minBeing written

Chapter 4 Classification

  1. 4.1

    k-Nearest Neighbours

    Classifying by the most similar examples

    Interactive: move a point and watch the vote

    10 minBeing written
  2. 4.2

    Decision Trees

    Classifying with a series of learned questions

    Interactive: grow a tree

    12 min Read
  3. 4.3

    Logistic Regression

    Predicting a probability for a yes-or-no answer

    Code: predict pass or fail

    P = 1 / (1 + e^−z)

    10 min Read
  4. 4.4

    Naive Bayes

    Classifying text with probabilities

    Code: classify messages

    10 minBeing written

Chapter 5 Clustering

  1. 5.1

    k-Means Clustering

    Finding groups in unlabelled data

    Interactive: watch centroids move

    12 min Activity

Chapter 6 Evaluating Models

  1. 6.1

    Accuracy and the Confusion Matrix

    True and false positives and negatives

    Code: build a confusion matrix

    10 min Read
  2. 6.2

    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)

    12 min Read
  3. 6.3

    Overfitting and Underfitting

    Memorising compared with generalising, and how to spot each

    Interactive: tree depth and test score

    10 min Read
  4. 6.4

    Cross-Validation

    A fairer estimate using several splits

    Code: five-fold cross-validation

    8 minBeing written

Chapter 7 Tools and Practice

  1. 7.1

    No-Code Machine Learning

    Building and comparing models visually with a data-mining tool

    Lab: classify the Iris dataset without code

    15 minBeing written
  2. 7.2

    The scikit-learn Workflow

    fit, predict, score and pipelines

    Code: a complete pipeline

    12 min Activity
  3. 7.3

    Project: Predict House Prices

    An end-to-end regression project

    Project notebook

    25 minBeing written
  4. 7.4

    Module Review and Assessment

    Coding exercises and a scored quiz

    Graded project checkpoints

    15 minBeing written