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.2Data cleaning
Back to Computer Science HL Topics
4.2.14 min read

Data cleaning (Computer Science HL)

IB Computer Science • Unit 4

Exam preparation

Practice the questions examiners actually ask

Our question bank mirrors real IB exam papers. Practice under timed conditions and track your progress across topics.

Start Practicing

Contents

  • Most of the work happens before training
  • Handling what is missing
  • Outliers, duplicates and consistency
  • Exam-style question
The big idea: A model learns whatever is in the data, including its faults.

Data cleaning is finding and fixing what is missing, duplicated, inconsistent or plainly wrong — and it routinely takes more time than building the model.

What goes wrong in real data

  • Missing values — a blank field, or a 0 that means "not recorded"
  • Duplicates — the same record entered twice, which quietly doubles its influence
  • Inconsistent formats — "UK", "U.K." and "United Kingdom" as three different countries
  • Outliers — a height of 3 metres, or a genuine extreme that must be kept
  • Wrong types — a number stored as text, so it sorts as "10" before "9"

Free preview

This is the free notes preview

You're reading the free notes. Aimnova Pro unlocks the full study experience — and you can try it with your first topic free to keep:

  • FlashcardsLock in vocabulary and key terms with spaced repetition.
  • Practice questionsAnswer exam-style questions and get instant AI marking.
  • Mock exams & past-paper vaultSit full mocks and see exactly how examiners award marks.
  • Personalised study planA daily plan built around your exam date and weak areas.
Start Studying Free Full access to Aimnova Pro · cancel anytime
ApproachDoesRisk
Delete the rowRemoves the record entirelyLoses everything else it held; biases the data if absence is not random
Delete the columnDrops the attributeFine if mostly empty; otherwise throws away a signal
Impute the meanFills with the averageShrinks the variance and invents data that was never observed
Flag itAdds a "was missing" columnKeeps the fact of absence, which is often informative
Absence is rarely random: If income is missing more often for low earners, deleting those rows makes the dataset richer than reality — and the model learns a world that does not exist.

Ask why a value is missing before deciding what to do with it.
A zero is not a blank: A recorded blood pressure of 0 is not a patient with no blood pressure — it is a missing reading encoded as a number.

A model treating it as real learns from an impossible value, and no error is ever raised.

See how examiners mark answers

Access past paper questions with model answers. Learn exactly what earns marks and what doesn't.

Try Exam Vault FreeYour first topic is free to keep • No credit card required

Outliers

  • An error — a typo, a sensor fault → remove or correct
  • A genuine extreme → keep; it may be the thing you care about
  • In fraud detection the outliers are the target
  • Deciding which needs domain knowledge, not a rule

Duplicates

  • Double the weight of one record on what the model learns
  • Often arrive from merging two sources
  • Exact duplicates are easy; near-duplicates are the problem
  • "J. Smith" and "John Smith" at one address

Consistency

  • One format per field, decided and applied
  • Dates, units, capitalisation, country names
  • kg against lb in one column is a silent disaster
  • The Mars Climate Orbiter was lost to exactly this
Garbage in, garbage out: The phrase is examinable, but say what it means: a model has no way to know a value is wrong. It fits the pattern it is given, including the faults, and reports high confidence either way.

How this is tested — you must name a specific data fault and say what it would do to the model. It comes up two ways:

Paper 1 Section A

  • Describe the significance of data cleaning, 3-4 marks
  • Identify problems in a described dataset
  • State one way to handle missing values

Paper 1 Section B — case study

  • Explain the consequence of a fault for a deployed model
  • Justify a choice between deleting and imputing
The classic trap: Answering "the data would be inaccurate". Name the specific fault and trace it to a specific effect on the model — zeros dragging an average down, duplicates doubling a record's weight. Vague harm earns vague credit.
IB-style questionDescribe[5 marks]

A hospital dataset records blood pressure, with missing readings stored as 0 and some patients entered twice. Describe the significance of cleaning this data before training a model.

Model answer plan

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

Claim your free topic

Try an IB Exam Question — Free AI Feedback

Test yourself on Data cleaning. Write your answer and get instant AI feedback — just like a real IB examiner.

one reason data cleaning is carried out before a neural network is trained. [1 mark]

Related Computer Science HL Topics

Continue learning with these related topics from the same unit:

4.1.1Types of machine learning
4.1.2Hardware for machine learning
4.2.2Feature selection
4.2.3Dimensionality reduction
View all Computer Science HL topics

Improve your exam technique

Command terms, paper structure, and mark-scheme tips for Computer Science HL

Previous
4.1.2Hardware for machine learning
Next
Feature selection4.2.2

1 questions to test your understanding

Reading is just the start. Students who tested themselves scored 82% on average — try IB-style questions with AI feedback.

Start FreeView All Computer Science HL Topics