IB Computer Science HL · Year 2 · Lesson 52

Supervised learning: regression, classification and evaluation

Machine-learning approaches differ in what they learn, how they are trained, how they are evaluated and which problems they suit.

Paper 150 minutesA4.3.1 · A4.3.2 · A4.3.3
Today’s targets

What you need to be able to do

2 / 10
  • ExplainHow linear regression is used to predict continuous outcomes
  • ExplainHow classifications techniques in supervised learning are used to predict discrete categorical outcomes
  • ExplainThe role of hyperparameter tuning when evaluating supervised learning algorithms
A4.3.1A4.3.2A4.3.3
Paper 1 lensMatch the depth of every response to the command term. Previously learned content can move quickly, but retrieval must still be accurate.
Retrieve

Rapid Recall Deck

3 / 10

Say the answer aloud before flipping. Mark secure knowledge quickly and spend time on the gaps.

  • What kind of outcome does linear regression predict?: A continuous numerical value.
  • What are the predictor and response variables in regression?: The predictor/independent variable is used as input; the response/dependent variable is the outcome being predicted.
  • What do the slope and intercept represent in a linear regression equation?: The slope is the predicted change in the response per unit change in the predictor; the intercept is the predicted response when the predictor is zero.
  • What does R² indicate in a regression model?: How much of the variation in the response is explained by the model; higher values generally indicate a closer fit to the observed data.
  • How does K-nearest neighbours (K-NN) classify a new data point?: It looks at the labels of nearby training examples and predicts a category based on those neighbours.
  • How does a decision tree classify data?: It follows a sequence of feature-based decision rules from the root to a leaf that assigns a category.
  • What do accuracy, precision, recall, and F1 score measure?: Accuracy is overall correctness; precision measures how many predicted positives are correct; recall measures how many actual positives are found; F1 balances precision and recall.
  • Why tune hyperparameters and watch for overfitting/underfitting?: Hyperparameters affect model behaviour; poor choices can underfit the data or overfit training examples and generalize badly to new data.
A4.3.1 + A4.3.2 · Learn

Core knowledge and application

4 / 10
A4.3.1Explain

How linear regression is used to predict continuous outcomes

Machine-learning approaches differ in what they learn, how they are trained, how they are evaluated and which problems they suit.

Exam moveGive the mechanism or relationship and make the reasons/causes explicit.
Required detail 1The relationship between the independent (predictor) and dependent (response) variables
Required detail 2The significance of the slope and intercept in the regression equation
Required detail 3How well the model fits the data—often assessed using measures like r2

Explain it without notes

Explain: How linear regression is used to predict continuous outcomes in the context of a team comparing candidate models for prediction, clustering and automation.

  • The relationship between the independent (predictor) and dependent (response) variables
  • The significance of the slope and intercept in the regression equation
  • How well the model fits the data—often assessed using measures like r2
A4.3.2Explain

How classifications techniques in supervised learning are used to predict discrete categorical outcomes

Machine-learning approaches differ in what they learn, how they are trained, how they are evaluated and which problems they suit.

Exam moveGive the mechanism or relationship and make the reasons/causes explicit.
Required detail 1K-Nearest Neighbours (K-NN) and decision trees algorithms to categorize new data points, based on patterns learned from existing labelled data
Required detail 2Real-world applications of K-NN may include collaborative filtering recommendation systems
Required detail 3Real-world applications of decision trees may include medical diagnosis based on a patient’s symptoms

Explain it without notes

Explain: How classifications techniques in supervised learning are used to predict discrete categorical outcomes in the context of a team comparing candidate models for prediction, clustering and automation.

  • K-Nearest Neighbours (K-NN) and decision trees algorithms to categorize new data points, based on patterns learned from existing labelled data
  • Real-world applications of K-NN may include collaborative filtering recommendation systems
  • Real-world applications of decision trees may include medical diagnosis based on a patient’s symptoms
A4.3.3 · Learn

Core knowledge and application

5 / 10
A4.3.3Explain

The role of hyperparameter tuning when evaluating supervised learning algorithms

Machine-learning approaches differ in what they learn, how they are trained, how they are evaluated and which problems they suit.

Exam moveGive the mechanism or relationship and make the reasons/causes explicit.
Required detail 1Accuracy, precision, recall and F1 score as evaluation metrics
Required detail 2Role of hyperparameter tuning on model performance
Required detail 3Overfitting and underfitting when training algorithms

Explain it without notes

Explain: The role of hyperparameter tuning when evaluating supervised learning algorithms in the context of a team comparing candidate models for prediction, clustering and automation.

  • Accuracy, precision, recall and F1 score as evaluation metrics
  • Role of hyperparameter tuning on model performance
  • Overfitting and underfitting when training algorithms
Worked example · A4.3.1–A4.3.3

Regression, classification and supervised-model evaluation

6 / 10

Linear regression

ŷ = 12 + 3.5x

12 is the intercept (prediction when x=0). 3.5 is the slope (predicted change in y per unit increase in x). R² summarizes how much variation is explained by the fitted relationship.

Classification

K-NN predicts using nearby labelled examples. Decision trees split data through learned decision rules. The best choice depends on data, problem and desired behaviour.

Pred +
Pred −
Actual +
TP = 18
FN = 4
Actual −
FP = 2
TN = 26
Accuracy(TP+TN)/all = 44/50 = 0.88
PrecisionTP/(TP+FP) = 18/20 = 0.90
RecallTP/(TP+FN) = 18/22 ≈ 0.82
F1harmonic mean of precision and recall ≈ 0.86
TuningHyperparameters are choices set around the learning process, not learned model parameters. Tune using validation evidence. Too much model complexity can overfit; too little can underfit.
Apply

Transfer to a new scenario

7 / 10
ScenarioA team comparing candidate models for prediction, clustering and automation needs a design or technical decision related to today’s topic. Explain what matters and why.
  • The relationship between the independent (predictor) and dependent (response) variables
  • The significance of the slope and intercept in the regression equation
  • K-Nearest Neighbours (K-NN) and decision trees algorithms to categorize new data points, based on patterns learned from existing labelled data
  • Real-world applications of K-NN may include collaborative filtering recommendation systems
  • Accuracy, precision, recall and F1 score as evaluation metrics
  • Role of hyperparameter tuning on model performance
Exam lens

Paper 1 practice

8 / 10
Build the response before checking notesUse precise terminology and match the required depth.
  1. Explain: How linear regression is used to predict continuous outcomes in the context of a team comparing candidate models for prediction, clustering and automation.
  2. Explain: How classifications techniques in supervised learning are used to predict discrete categorical outcomes in the context of a team comparing candidate models for prediction, clustering and automation.
  3. Explain: The role of hyperparameter tuning when evaluating supervised learning algorithms in the context of a team comparing candidate models for prediction, clustering and automation.
Self-checkAnswer the exact command term. For explain, include mechanism/reason; for compare, pair criteria; for discuss/evaluate/justify, build supported reasoning and a conclusion.
2027 Case Study

Generative AI research checkpoint

9 / 10

Build a reusable evidence bank for Paper 1 Section B. Keep claims technical, specific and supported.

Convolutional neural network (CNN)A neural network architecture that learns spatial features using convolution operations; commonly used with image data.
Know and apply in case-study context
Image generationCreating new images with a generative model rather than retrieving an existing image.
Know and apply in case-study context
Text-to-image generationCreating an image from a natural-language prompt.
Know and apply in case-study context
GeneratorThe GAN network that transforms random input into synthetic examples intended to resemble training data.
Deep for HL where tied to GAN/hybrid challenges
Homework

Finish the learning cycle

10 / 10

Exam preparation — main task

Complete targeted 2027 case-study research and cumulative Paper 1/Paper 2 practice. Record evidence and technical vocabulary you can use in extended responses.

Retrieval

Repeat today’s recall deck and revisit any item marked ‘Review again’.