State why data quality matters and describe the six common data quality dimensions.
Define missing values, give their common causes, and name the three types of missingness.
Describe the methods for handling missing values and what should guide the choice.
Explain what duplicate records are, why they matter, and how to detect and remove them.
Define an outlier and explain how to detect one using the IQR and Z-score methods.
List and explain the options for handling an outlier once it is found.
Explain why categorical data must be encoded and why the choice of method matters.
Compare label encoding and one-hot encoding, including when to use each.
Explain why features are scaled and where scaling matters most.
Give the min-max normalization and z-score standardization formulas and explain when to use each.
Define incorrect data, give examples, and explain what is needed to catch it.
Define noise, distinguish it from outliers, and explain where it appears and why it matters.
Define data validation, list the four checks, and state when validation should happen.
Define data integrity and explain the practices that maintain it.
| Dimension | Meaning | Example |
|---|---|---|
| Accuracy | Data correctly reflects the real-world values and events it represents. | A customer's email address is spelled correctly. |
| Completeness | All required data is present and nothing important is missing. | Every customer record has an email, phone number, and address. |
| Consistency | Data is uniform across different systems and formats. | "USA", "U.S.", and "United States" are used consistently. |
| Timeliness | Data is up-to-date and available when it is needed. | Inventory levels are updated in real time as items are sold. |
| Uniqueness | Each piece of data is unique and not duplicated unnecessarily. | No duplicate customer profiles exist in the database. |
| Validity | Data conforms to defined rules, formats, and business constraints. | A date of birth is a valid date (e.g., not 02/30/2024). |
High-quality data builds trust, improves decisions, reduces costs, and drives better business outcomes.
Handling missing values:
Detection methods:
| Method | Rule | Note |
|---|---|---|
| IQR (Interquartile Range) | Flag x if x < Q1 − 1.5×IQR or x > Q3 + 1.5×IQR, where IQR = Q3 − Q1. | More robust to extreme values. |
| Z-score | z = (x − μ) / σ; commonly flag |z| > 3 (μ = mean, σ = standard deviation). | Assumes a roughly normal distribution. |
Visual methods work too: box plots and scatter plots make outliers easy to spot by eye.
Handling outliers: investigate first (genuine vs. error); remove it (if clearly an error that would distort analysis); cap or limit it (winsorizing — pull extremes toward a reasonable boundary); transform the data (e.g., a log transform); or keep it (if it is a genuine, meaningful data point for your question).
| Aspect | Label Encoding | One-Hot Encoding |
|---|---|---|
| How it works | Assigns each category an integer (Red=0, Blue=1, Green=2). | Creates a separate binary (0/1) column for each category. |
| Order | Implies a false order — e.g., Red (0) < Blue (1) < Green (2). | No ordinal relationship — each category is independent. |
| Trade-off | Simple, but the implied order can mislead. | No false order, but adds more columns. |
| Best for | Ordinal data (e.g., Low/Medium/High). | Nominal data (no natural order). |
| Method | Formula | Notes |
|---|---|---|
| Min-Max Normalization | x' = (x − min(x)) / (max(x) − min(x)) | Rescales values into a fixed [0, 1] range. Sensitive to outliers. Use when you need a strictly bounded range (e.g., neural network inputs). |
| Z-Score Standardization | z = (x − μ) / σ | Centers data around a mean of 0 with a standard deviation of 1. More robust when outliers are present. Use when data may contain outliers or is not uniformly distributed. |
| Issue | Example from the lecture |
|---|---|
| Impossible age | 250, 1500 |
| Negative price | −$10.00 |
| Misspelled month | "Februarry" instead of "February" (bullet text: "Februaryy") |
| Invalid date | 13/32/2026 |
| Inconsistent units / values | Leads to errors and bad insights. |
Data validation is checking that data meets defined rules before it is used.
| Check | Question it asks |
|---|---|
| Type check | Is this actually a number, date, or text as expected? |
| Range check | Is age between 0 and 120? Is a percentage between 0 and 100? |
| Format check | Is the email address, phone number, or date properly formatted? |
| Consistency check | Does the end date come after the start date? |
Validation should happen as early as possible — ideally right at the point of collection.
Everything on this page comes from Lecture 2 — Data Preparation and Preprocessing for Artificial Intelligence (Dr. Al Amin), 20 slides, posted to Blackboard. Quiz 2 is due 9/1. This module is covered on the Midterm (Modules 1–9), moved to Tue Oct 27.