Data Preprocessing
Cleaning and transforming raw data before training or inference.
Can these readings share a column?
A fictional equipment log contains 68 °F, 20 °C and a blank cell. Sorting the raw numbers puts 68 above 20, although the two measured temperatures are equal.
| Raw record | Normalized value | Status |
|---|---|---|
| 68 °F | 20 °C | Converted |
| 20 °C | 20 °C | As supplied |
| Blank | Missing | No reading |
What changed during preprocessing?
Subtract 32 from the Fahrenheit value and multiply by 5/9. Keep the original unit and value for traceability. A blank reading carries different information from a measured zero. Imputation, if appropriate, needs a documented rule and a way to identify estimated values.

Where can information leak into the pipeline?
A fixed unit conversion uses no learned statistics. An imputer or scaler fitted to the complete dataset can reveal information about held-out records. Fit those steps on training data and apply the fitted transformations to validation, test and production inputs.
Follow the idea
Data Governance · Inspect the evidence behind a missing or inconsistent value.
Feature Engineering · See how a new predictive variable is derived.
Source · Scikit-learn on consistent preprocessing and leakage
Return to Data Preprocessing in the A–Z glossary