aimnova.
DashboardMy LearningPaper MasteryStudy Plan

Aimnova site navigation

Stay in the loop

Get the latest study resources and updates

New features, study tips and exam insights — straight to your inbox.

IB Diploma

  • IB Past Papers
  • IB Study Notes
  • IB Question Bank
  • IB Mock Exams
  • IB Revision

IB Subjects

  • IB Math AA
  • IB Math AI
  • IB Economics
  • IB Business Management
  • IB Physics
  • IB Biology
  • View all IB subjects→

IB Past Papers

  • IB Math AA HL Past Papers
  • IB Math AA SL Past Papers
  • IB Math AI HL Past Papers
  • IB Math AI SL Past Papers
  • IB Economics HL Past Papers
  • IB Economics SL Past Papers
  • IB ESS Past Papers
  • View all past papers→

Study Resources

  • Study Notes
  • Question Bank
  • Mock Exams
  • Flashcards
  • Revision Guide
  • Exam Skills
  • Command Terms
  • Grade Calculator
  • Exam Timetable 2026

Aimnova

  • Features
  • Pricing
  • For Schools
  • For Parents
  • About Us
  • Blog
  • Contact
aimnova.

AI-powered study platform for smarter revision, past-paper analysis and examiner-style feedback.

TermsPrivacyCookies·© 2026 Aimnova. All rights reserved.8afc4e3

Aimnova is not affiliated with or endorsed by the International Baccalaureate Organization (IB).

NotesComputer Science HLTopic 4.2
Unit 4 · Machine learning · Topic 4.2

IB Computer Science HL — Data preprocessing

Data preprocessing

Higher Level students should use this topic hub as a map: start with the shared sub-topics, then follow the HL-only extensions and exam-skill links where this topic asks for deeper analysis.

Exam technique guidePractice questions

Key concepts in Data preprocessing

Key Idea: A model learns whatever is in the data — including its faults, and no fault raises an error. Most of the work in machine learning happens before training: fixing what is wrong, choosing what the model sees, and cutting what it does not need.

Paper 1

  • Define a method; compute a measure.
  • Identify which approach a scenario needs.

Paper 2

  • Evaluate a model against an alternative.
  • Reason about a reward or fitness function.

Both

  • Name what is given up, not only what is gained.

🧼 Cleaning

FaultWhat it does to the model
Missing valuesA 0 meaning "not recorded" is learned as a real, impossible value
DuplicatesThat record's characteristics carry double weight
Inconsistent formats"UK" and "United Kingdom" become two different countries
OutliersAn error should go; a genuine extreme may be the target
Important: If income is missing more often for low earners, deleting those rows makes the data richer than reality. Ask WHY a value is missing before deciding what to do with it.

🎯 Feature selection

What to drop, and why

  • Identifier — unique per row, so the model memorises and generalises nothing
  • Leaking — contains the answer, or is unknown at prediction time. Test accuracy looks superb and then collapses
  • Redundant — height in cm and in inches say the same thing twice
  • Constant — no information at all
  • Removing a sensitive attribute does not remove it: postcode and school are proxies
Would we actually know this at the moment the prediction has to be made? If not, it is leakage, however well it scores in testing.

📉 Dimensionality reduction

SelectionExtraction (PCA)
KeepsOriginal columnsNew ones built from combinations
InterpretableYesNo — a component is a mixture
Reduces furtherLessMore — correlated features merge
Prefer whenA decision must be explainedOnly predictive power matters
Important: Each extra feature grows the space exponentially, so the same records become sparse inside it. Distances stop meaning anything, and exponentially more data is needed to see a pattern at all.

📝 Exam-style questions

IB-style questionExplain[5 marks]

A recruitment model is trained on ten years of hiring decisions and scores 96% on held-out data. The company removes the gender field before training. Explain why this does not make the model fair, and what the 96% may be hiding.

🔒 Model answer plan

See the mark-by-mark plan — for / against / judgement, with marking guidance — in study mode.

Claim your free topic →
IB-style questionDescribe[4 marks]

A dataset has 3,000 features and 500 records. Describe two problems this creates and one way to address them.

🔒 Model answer plan

See the mark-by-mark plan — for / against / judgement, with marking guidance — in study mode.

Claim your free topic →

✅ Quick check

Cover the answers.

Why is a recorded 0 dangerous? It may mean not recorded. The model learns from an impossible value, and nothing reports it.

What is data leakage? A feature containing the answer, or unavailable at prediction time. Test accuracy looks superb, then collapses.

Does dropping a sensitive attribute remove bias? No — other fields proxy for it and the model finds those instead.

What is the curse of dimensionality? More features means an exponentially larger space, so data becomes sparse and distances stop meaning anything.

Selection or extraction — which keeps meaning? Selection. Extraction builds mixtures that cannot be explained to the person a decision was made about.


Exam tips

  • Name a SPECIFIC fault and trace it to a specific effect on the model.
  • Ask of every feature: would we know this at prediction time?
  • Suspiciously high accuracy is a leakage symptom, not a success.
  • Proxies survive the removal of a sensitive attribute. Name them.
  • Reduction is lossy — say what is given up, not just what is gained.

What you'll learn in Topic 4.2

  • 4.2.1 Data cleaning
  • 4.2.2 Feature selection
  • 4.2.3 Dimensionality reduction
Suggested study order: Read the notes for each sub-topic below → test yourself with flashcards → attempt practice questions → review exam technique.

Study resources — 4.2 Data preprocessing

4.2.1

Data cleaning

Notes
4.2.2

Feature selection

Notes
4.2.3

Dimensionality reduction

Notes

Ready to study Data preprocessing?

Get expert practice questions with instant AI feedback, and a study planner tailored to your IB Computer Science HL exam date.

Start studying free

Topic 4.2 Data preprocessing forms a core part of Unit 4: Machine learning in IB Computer Science HL. Mastering these concepts will strengthen your understanding of connected topics across the syllabus and prepare you for exam questions that require analysis, evaluation, and real-world application.

Previous topic
4.1 Machine learning fundamentals
Next topic
4.3 Machine learning approaches
All Computer Science HL topics
Exam technique

Ready to practice?

Get AI-graded practice questions, mock exams, flashcards, and a personalised study plan — all aligned to your IB syllabus.

Start Studying Free

No credit card required · No time limit