← IB Computer Science

Training models and neural networks

Topic A4 is Higher Level (HL) only. This unit is about how models are actually built and judged: preparing data, splitting it, spotting overfitting and underfitting, measuring performance with accuracy, precision, recall and F1, and tuning hyperparameters. It ends with the basics of artificial neural networks (ANNs), perceptrons and convolutional neural networks (CNNs).

Slide 1 / 4

Training, testing and data quality

The machine-learning workflow Gather data Pre-process Splitdata Train Evaluate Tune tune & retrain Split the cleaned data Training set (~80%) Test (~20%) Clean first: garbage in, garbage out Normalize (min-max) → rescale to 0–1 Standardize (Z-score) → mean 0, SD 1 Feature selection: keep informative attributes, drop redundant ones
  • Models learn by training on prepared data; the machine learning workflow includes gathering data, preprocessing, splitting the data, training, evaluating and tuning.
  • Data cleaning turns noisy data into data that is consistent, error-free and accurate; the book's rule of thumb is good data equals good predictions (garbage in, garbage out).
  • Normalization (min-max scaling) rescales features into a set range such as 0 to 1, while standardization (Z-score) rescales them to a mean of 0 and a standard deviation of 1.
  • Feature selection keeps the most informative attributes and removes redundant or irrelevant ones, which reduces overfitting, speeds up training and improves interpretability.

Check you've got it

0/4

1. A model scores 99% on the data it was trained on but only 60% on new, unseen data. What is this an example of?

2. Which statement about a hyperparameter is correct?

3. What happens during back propagation in a neural network?

4. A disease-screening model must avoid missing patients who actually have the disease. Which evaluation metric is most important here?

Free revision content. Multiple-choice answers are marked instantly. Written answers are marked by AI on /free-mark.