Why data quality decides AI quality
The fastest way to a better model is usually better data. This module shows you what 'good data' means and why AI makes it matter more.
Learning objectives
- Explain the data-centric view of AI
- Assess data on six quality dimensions
- Explain why data errors matter more in AI
- Outline the data preparation workflow
- Show how a few bad values distort simple statistics
- Apply the six dimensions to documents used by AI assistants
1.1 Garbage in, garbage out
A model can only be as good as the data it learns from and the data it's given. Better algorithms rarely rescue bad data, but better data often rescues an ordinary algorithm. This idea — improving the data rather than endlessly tuning the model — is sometimes called data-centric AI.
Demand for these skills is growing fast: Coursera's 2026 job skills research reports data quality and data cleansing among the fastest-growing data skills, each roughly doubling in enrolments.
1.2 Six dimensions of data quality
| Dimension | Question | Example problem |
|---|---|---|
| Accuracy | Does it reflect reality? | Age recorded as 230 |
| Completeness | Is anything missing? | No signup date for some customers |
| Consistency | Is the same thing recorded the same way? | "UK", "uk", "United Kingdom", "U.K." |
| Validity | Does it follow the rules and formats? | A date of "2025-13-01" (month 13) |
| Uniqueness | Are there duplicates? | The same customer appearing twice |
| Timeliness | Is it up to date? | Prices from last year used to predict demand |
1.3 Why it matters more for AI
- Models learn patterns — including errors. Mislabelled examples teach the wrong lesson.
- Problems are invisible in outputs. A model trained on skewed data still produces confident predictions.
- Errors scale. One bad rule in a spreadsheet affects one report; a model trained on it affects every decision it makes.
- Unrepresentative data creates unfair outcomes for groups that are under-represented (Module 5).
- Law requires it for high-risk AI. The EU AI Act's Article 10 sets data governance requirements for training, validation and testing data of high-risk systems (Module 6).
1.4 The data preparation workflow
- Understand the purpose and where the data comes from.
- Profile it — measure what's there (Module 2).
- Clean it — fix, remove or flag problems (Module 3).
- Label it, if the task needs labels (Module 4).
- Check representativeness and split it for training and testing (Module 5).
- Document and govern it (Module 6).
1.5 The practice dataset
Throughout this course you'll use a small, deliberately messy customer table. Every code block is a live cell: press Run and it runs in your browser, and you can edit the code and run it again. Basic Python and pandas are assumed (see Python for AI).
Python · the practice dataset used in this courseimport pandas as pd
import numpy as np
customers = pd.DataFrame({
"customer_id": [101, 102, 103, 103, 104, 105, 106, 107, 108, 109],
"signup_date": ["2025-01-04", "04/02/2025", "2025-02-10", "2025-02-10", "2025-03-15",
"2025-13-01", "2025-04-02", None, "2025-05-20", "2025-06-01"],
"country": ["UK", "United Kingdom", "uk", "uk", "Ireland", "UK", "IE", "UK", "U.K.", "UK"],
"age": [34, 29, None, None, 41, 230, 38, 27, -1, 52],
"monthly_spend": [42.5, 18.0, 63.2, 63.2, None, 25.0, 12000.0, 31.4, 22.0, 47.9],
"churned": ["no", "yes", "No", "No", "no", "yes", "no", "YES", "no", "no"],
})
print(customers)
Before running any more code, list every data quality problem you can see in the table, and which dimension each belongs to.
Show what to look for
Duplicate customer 103 (uniqueness); mixed date formats and an invalid month 13 (validity, consistency); missing signup date (completeness); five spellings of the UK and two of Ireland (consistency); ages 230 and −1 (accuracy, validity); missing age and spend (completeness); a spend of 12,000 that may be an outlier or error (accuracy); "no", "No", "yes", "YES" (consistency).
1.6 What bad data does to a simple answer
You don't need a model to see the damage. Ask the raw table two ordinary business questions:
Python · two questions, asked of the raw dataprint("Average monthly spend: £", round(customers["monthly_spend"].mean(), 2))
print("Typical (median) spend: £", customers["monthly_spend"].median())
print("Average age:", round(customers["age"].mean(), 1))
print("Customers by country:")
print(customers["country"].value_counts())
One wrong value drags the average spend to over a thousand pounds when a typical customer spends about forty. The average age is inflated by a 230-year-old. The country count says the business has six markets when it has two. Nothing here raised an error: pandas answered every question confidently, and every answer was wrong. A machine learning model trained on this table would behave the same way.
1.7 Documents are data too
Much of today's AI doesn't learn from tables. AI assistants and chatbots answer questions by looking things up in a company's documents: policies, product pages, help articles, past tickets. (This is retrieval-augmented generation; see Building LLM Applications with RAG.) The same six dimensions apply, and the same rule: the assistant can only be as good as what it's given.
| Dimension | What goes wrong in a document collection |
|---|---|
| Accuracy | A help article describes a feature that was never released |
| Completeness | The returns policy exists for the UK but not for Ireland |
| Consistency | Two documents give different refund periods |
| Validity | Tables and prices garbled when a PDF was converted to text |
| Uniqueness | Five near-identical copies of one policy, so search results fill up with duplicates |
| Timeliness | Last year's price list is still in the folder, and the assistant quotes it |
When an AI assistant gives a customer the wrong refund period, the cause is far more often an out-of-date or contradictory document than a fault in the model. You'll profile and clean a small document set in Modules 2 and 3.
Count how many values are missing in each row of customers (hint: isna().sum(axis=1)), then print the rows with at least one missing value. What share of the table is that?
Your turn# Write your code here, then press RunShow a solution
missing_per_row = customers.isna().sum(axis=1)
print(customers[missing_per_row > 0])
print("Share of rows with a missing value:", (missing_per_row > 0).mean())
# Missing values are only one kind of problem. Module 2 finds the rest.Key takeaways
- Better data often beats a better algorithm.
- Accuracy, completeness, consistency, validity, uniqueness and timeliness.
- Models learn errors and scale them.
- Understand → profile → clean → label → split → document.
- Bad data doesn't raise errors: it gives confident wrong answers.
- The documents behind an AI assistant need the same quality checks as a table.