Chapter 5
Data Pre-processing
Why real data is dirty, the five forms of preprocessing, handling missing values, smoothing by binning, aggregation, generalisation, min-max normalization and data reduction.
From: Chapter 5_Data Preprocessing.pptx
Why preprocess? (slides 2–3)
- Main goal: make the statistical distribution of each net input and output roughly uniform: values spread evenly across a range.
- A NN will not forecast accurately with incomplete, noisy and inconsistent data. Decisions here are critical to performance.
- Real data is dirty: incomplete (missing values or attributes, or only aggregates), noisy (errors, outliers), inconsistent (different formats in codes or names).
Five forms of preprocessing (slide 4)
| Form | What it does |
|---|---|
| Data cleaning | Fill in missing values, smooth noise, correct inconsistencies |
| Data integration | Merge data from multiple stores (e.g. data warehouse). Watch schema integration and redundancy |
| Data transformation | Convert into appropriate forms: smoothing, aggregation, generalization, normalization |
| Data reduction | Get a much smaller representation that keeps the data's integrity |
| Data discretization | Part of reduction: convert continuous data into discrete bins or intervals |
Handling missing values (slide 5)
- 1. Ignore the tuple: not very effective unless the tuple has several missing attributes.
- 2. Fill in manually: time-consuming, may be infeasible for large data.
- 3. Global constant (e.g. “Unknown”): simple but not recommended.
- 4. Attribute mean.
- 5. Most probable value: via regression, Bayesian inference or decision tree induction. The popular strategy.
- Methods 3–5 bias the data; the filled-in value may be wrong.
Regression can smooth data or predict missing values by fitting a function such as y = x + 1. An outlier is a point significantly different from the rest (it doesn't fit the pattern).
Data transformation (slides 8–11)
- Smoothing: remove noise, by binning, clustering or regression.
- Aggregation: summarise, e.g. daily sales → monthly and yearly totals.
- Generalization: replace low-level data with higher-level concepts via concept hierarchies, e.g. street → city → country; age → young / middle-aged / senior.
- Normalization: scale into a small range such as −1.0 to 1.0 or 0.0 to 1.0. Speeds up learning.
Smoothing by binning (slide 9)
- Sorted prices: 4, 8, 9, 15, 21, 21, 24, 25, 26, 28, 29, 34.
- Equal-depth bins: Bin 1 = 4, 8, 9, 15; Bin 2 = 21, 21, 24, 25; Bin 3 = 26, 28, 29, 34.
- By bin means: Bin 1 → 9, 9, 9, 9; Bin 2 → 23, 23, 23, 23; Bin 3 → 29, 29, 29, 29.
- By bin boundaries (each value → nearest of min/max): Bin 1 → 4, 4, 4, 15; Bin 2 → 21, 21, 25, 25; Bin 3 → 26, 26, 26, 34.
Min-max normalization (slide 13)
v′ = (v − min) / (max − min) × (new_max − new_min) + new_min
Income example
- min = RM12,000, max = RM98,000, new range [0.0, 1.0].
- v = RM73,600: (73,600 − 12,000) / (98,000 − 12,000) × (1.0 − 0.0) + 0 = 61,600 / 86,000 = 0.716.
- RM12,000 → 0.000; RM30,000 → 0.209; RM98,000 → 1.000.
Data reduction strategies (slide 14)
- Data cube aggregation: aggregation operations while building a data cube.
- Dimension reduction: detect and remove irrelevant, weakly relevant or redundant attributes.
- Data compression: encoding to shrink the data set.