Data preprocessing (also called data preparation) is the set of steps that converts raw, messy data into a clean, structured and numeric form that a machine learning algorithm can learn from.
Real-world data is rarely ready to use. It usually contains:
- missing entries and blank cells,
- duplicated or contradictory records,
- values in inconsistent formats (
2026-04-28vs28/04/26), - extreme values (outliers),
- text categories that algorithms cannot read directly,
- features measured on very different scales.
Preprocessing fixes these problems before modeling, so the model learns real patterns instead of noise.
Where preprocessing fits in the ML workflow
Raw Data -> Cleaning -> Missing Values -> Outliers -> Train/Test Split
-> Feature Engineering / Selection / Scaling -> Model -> Evaluation
"Garbage in, garbage out." A powerful algorithm trained on poor data will still produce poor predictions.
Two goals of preprocessing
- Make data usable — remove errors, fill gaps, convert everything to numbers.
- Make data informative — create, select and scale features so patterns are easier to learn.