Scribe logoScribeNotes & practice
Sign inStart free
  1. Notes
  2. ›IB Computer Science
  3. ›A4 Machine learning
  4. ›A4.1 Machine learning fundamentals

IB Computer Science · A4 · Machine learning

A4.1 Machine learning fundamentals

Describe what machine learning is, explain the role of training data, and outline the common tasks and workflow.

  • 4 min read
  • 5 parts
  • 10 questions
  • Draft
Start a Quick 5 on this topic→Jump to the 10 questions
1/5Machine learning lets programs learn rules from data
  1. 1Machine learning lets programs learn rules from data
  2. 2Training data shapes what a model can learn
  3. 3Held-back data shows how well a model generalises
  4. 4Machine learning solves several common kinds of task
  5. 5A workflow turns a problem into a working model
  6. Check your recall
  7. Practice: 10 questions
1

Part 1 of 5: Machine learning lets programs learn rules from data

A spam filter could be written by hand, with one rule for every suspicious phrase. That list would never be complete. Machine learning takes another route: the program finds patterns in examples and builds its own rules.

In traditional programming, a person writes the rules and the computer applies them to data to get answers. In machine learning, the computer receives data and known answers, then produces the rules. These learned rules form a model.

Common mistake

A model does not usually rewrite itself while you use it. It is normally fixed after training and then applied to new data.

Key terms · tap one for its definition

machine learning

Machine learning is the use of algorithms that learn patterns from data to make predictions or decisions without being given explicit rules.

model

A model is the set of rules or patterns, produced by training, that is used to make predictions on new data.

Part 1 done

2

Part 2 of 5: Training data shapes what a model can learn

Since a model comes from examples, the examples matter a great deal. The examples used to build it are the training data. Each example has several inputs. Each input is a feature, a measurable property such as a house’s floor area.

Many tasks also give each example a label, the known correct answer, such as the house’s sale price. The model compares its guesses with the labels and improves.

A model can only reflect patterns that its data contains. Too few examples, or examples that miss common cases, give a weak model. Both the quality and the quantity of data count.

Key terms · tap one for its definition

training data

Training data is the set of examples from which a model learns its rules.

feature

A feature is a measurable property of an example that is given to a model as input.

label

A label is the known correct output attached to a training example.

Part 2 done

Quick check

One question on the part you just read

Easy

State what a model is in machine learning.
Show answer and explanation

Answer: A · Worked explanation

A model is the output of training: the learned rules or patterns applied to new data. The collection of examples is the training data, not the model. Hand-written if-then rules belong to traditional programming, where a person supplies the rules instead of the computer learning them.
3

Part 3 of 5: Held-back data shows how well a model generalises

Training data alone cannot show whether a model works. A model might simply memorise its examples. So some data is kept back as testing data, and the model never sees it during training.

Accuracy on the testing data estimates how the model will perform on new cases. A model that scores well on training data but poorly on testing data shows overfitting. It has learned quirks of its examples instead of the general pattern.

Exam tip

If asked why data is split, say that testing data gives an honest estimate of performance on unseen cases.

Key terms · tap one for its definition

testing data

Testing data is a set of examples, kept separate from the training data, used to measure how well a model performs on unseen cases.

overfitting

Overfitting is the fitting of a model so closely to its training data that it performs worse on new data.

Part 3 done

4

Part 4 of 5: Machine learning solves several common kinds of task

With the data question settled, consider what models are used for. Five kinds of task appear often.

  • Sorting items into categories, such as spam and not spam.
  • Predicting a number, such as the price of a house.
  • Grouping similar items when no categories are given, such as customer groups.
  • Recommending items a user may like, based on past behaviour.
  • Spotting unusual cases, such as a suspicious card payment.

Image recognition is a familiar example of the first kind. Each picture is assigned to a category, such as cat or dog.

Part 4 done

Quick check

One question on the part you just read

Easy

In a house-price dataset, which item is the label?
Show answer and explanation

Answer: C · Worked explanation

The label is the known correct answer for each example, here the sale price the model must learn to predict. Floor area, bedrooms and postcode are features, which are inputs describing each house. Features are given to the model, whereas the label is what the model tries to match.
5

Part 5 of 5: A workflow turns a problem into a working model

Real projects follow a repeatable sequence. Each step feeds the next, and poor results often send you back to an earlier step.

  • Define the problem and decide how success will be measured.
  • Collect the data and prepare it for use.
  • Split the data into training and testing sets.
  • Train a model on the training data.
  • Evaluate the model on the testing data.
  • Deploy the model and monitor it on real data.
Figure 1. The six steps run in order, and the results of evaluation or monitoring can send a project back to an earlier step.

If evaluation is poor, you might collect more data or change the model. After deployment, accuracy can fall as real-world data changes, so monitoring continues.

Key term

deployment

Deployment is the stage at which a trained model is put into real use to make predictions on new data.

Note read

Check your recall[14 marks]

5 written questions. Answer each one in your head or on paper, then open the mark scheme.

  1. 1.Distinguish[3 marks]

    Distinguish between traditional programming and machine learning.

    Show mark schemeHide mark scheme

    Model answer

    In traditional programming a person writes the rules, and the computer applies them to data to give answers. In machine learning the computer is given data, often with known answers, and produces the rules itself. The learned rules form a model.

    • 1 mark for stating that in traditional programming a person writes the rules
    • 1 mark for stating that in machine learning the computer learns the rules from data
    • 1 mark for stating that the learned rules form a model that is applied to new data
  2. 2.Explain[3 marks]

    Explain why data is split into training and testing sets.

    Show mark schemeHide mark scheme

    Model answer

    The model learns from the training set. The testing set contains cases the model has not seen. Accuracy on it estimates how the model will perform on new data and can reveal overfitting.

    • 1 mark for stating that the model is trained on the training set only
    • 1 mark for stating that the testing set contains unseen cases
    • 1 mark for explaining that testing accuracy estimates performance on new data or reveals overfitting
  3. 3.State[2 marks]

    State two tasks that machine learning can solve.

    Show mark schemeHide mark scheme

    Model answer

    Sorting items into categories, such as spam filtering. Predicting a number, such as a house price.

    • 1 mark for stating one valid task
    • 1 mark for stating a second valid task, such as grouping similar items, recommending items or spotting unusual cases
  4. 4.Outline[3 marks]

    Outline the main steps of a machine learning workflow.

    Show mark schemeHide mark scheme

    Model answer

    Define the problem, then collect and prepare data. Split the data, train a model and evaluate it on testing data. Finally deploy the model and monitor it.

    • 1 mark for stating that the problem is defined and data is collected and prepared
    • 1 mark for stating that the data is split, a model is trained and it is evaluated on testing data
    • 1 mark for stating that the model is deployed and monitored
  5. 5.Discuss[3 marks]

    Discuss why having a very large dataset does not guarantee a good model.

    Show mark schemeHide mark scheme

    Model answer

    A large dataset may contain errors or missing cases, so quality matters as well as quantity. If it misses common cases, the model will perform badly on them. A model can also overfit, learning quirks instead of general patterns.

    • 1 mark for stating that data quality matters as well as quantity
    • 1 mark for explaining that data missing common cases leads to weak performance on them
    • 1 mark for explaining that overfitting can occur whatever the dataset size

Practice this topic

10 quick-fire multiple-choice questions, easy to hard. Tap an answer to see if you're right and the worked explanation. (The written questions with mark schemes are under “Check your recall” above.)

0 right0 of 10 answered

Includes the 2 quick checks in the note above.

3.

Easy[1 mark]

A music app suggests new songs based on what a listener has played before. Which kind of task is this?
Show answer and explanation

Answer: B · Worked explanation

Suggesting songs from past behaviour is recommendation. Predicting a number would produce a value such as a price, not a list of songs. Spotting unusual cases looks for rare items such as fraud, which is not the aim of suggesting music a listener may enjoy.
4.

Medium[1 mark]

A model scores 99% on its training data and 62% on its testing data. What is the most likely cause?
Show answer and explanation

Answer: D · Worked explanation

A large gap between training and testing accuracy is the sign of overfitting. If the testing data had been used in training, testing accuracy would also be high. An untrained model would score poorly on both sets, not 99% on the training data.
5.

Medium[1 mark]

A bank is building a model to flag unusual card payments. Which workflow step comes directly before training the model?
Show answer and explanation

Answer: C · Worked explanation

The data is split into training and testing sets before training begins, so that the model can be tested on unseen cases afterwards. Evaluation needs a trained model and therefore comes after training. Deployment and monitoring come last, once evaluation is satisfactory.
6.

Medium[1 mark]

A dataset has 2000 examples. 80% are used for training and the rest for testing. How many examples are in the testing set?
Show answer and explanation

Answer: B · Worked explanation

The testing share is 100%−80%=20%100\% - 80\% = 20\%100%−80%=20%. Then 20100×2000=400\frac{20}{100} \times 2000 = 40010020​×2000=400 examples. The value 1600 is the size of the training set, found by taking 80% instead of the remaining 20%. The testing set is the smaller share here.
7.

Medium[1 mark]

Method X uses hand-written rules to detect spam. Method Y is given thousands of emails marked spam or not spam and finds its own rules. Which statement is correct?
Show answer and explanation

Answer: A · Worked explanation

In machine learning the rules come from the data. Method Y finds them from labelled examples, so it is machine learning. Method X has rules written by a person, which is traditional programming. Supplying data does not make a method traditional, because both approaches use data.
8.

Hard[2 marks]

A model for recognising skin conditions is trained only on photographs of one skin tone. What is the most likely result?
Show answer and explanation

Answer: C · Worked explanation

A model reflects the patterns in its data, so missing cases lead to weaker performance on them. High training accuracy says nothing about unseen groups. Longer training on the same photographs cannot add information that is missing, and it may increase overfitting.
9.

Hard[2 marks]

After deployment, a delivery-time model slowly becomes less accurate although its rules have not changed. Which is the best explanation?
Show answer and explanation

Answer: A · Worked explanation

A fixed model only knows the patterns in its training data. If traffic, roads or customer habits change, new data no longer fits those patterns and accuracy falls. This is why monitoring is part of the workflow. A model does not forget rules, and training data is not used up by predictions.
10.

Hard[2 marks]

Which statement about testing data is correct?
Show answer and explanation

Answer: B · Worked explanation

Testing data estimates performance on new cases, so it must be unseen. Training on it, or copying the training data, would give an over-optimistic score that hides overfitting. Testing data is needed whatever the dataset size, because any model can overfit its training examples.

Keep going

Next topicA4.2 Data preprocessingPrevious topicA3.4 Alternative databases and warehouses

More in A4 · Machine learning

  1. A4.1Machine learning fundamentalsNotes · 10 questions
  2. A4.2Data preprocessingNotes · 10 questions· HL only
  3. A4.3Machine learning approachesNotes · 10 questions· HL only
  4. A4.4Ethical considerationsNotes · 10 questions

All IB Computer Science topics →

Draft: written by Scribe and checked automatically, not yet by a subject reviewer.

Practice questions are original, written by Scribe and checked automatically for correctness.

Topic codes follow the official numbering. Not endorsed by IB Diploma Programme or any exam board.

On this page

0/5 read

  1. 1Machine learning lets programs learn rules from data
  2. 2Training data shapes what a model can learn
  3. 3Held-back data shows how well a model generalises
  4. 4Machine learning solves several common kinds of task
  5. 5A workflow turns a problem into a working model
  6. Check your recall
  7. Practice: 10 questions
All coursesScribeHow it worksPricingPrivacyTerms

Notes and questions are written by Scribe in our own words. Topic codes follow the official course numbering so you can find your place. Not produced or endorsed by the IB, College Board, AQA, OCR, Pearson Edexcel or any exam board.

© 2026 Scribe