An outlier is a data point that deviates significantly from the rest of the dataset. Outliers can be genuine rare events (a billionaire in an income survey) or plain mistakes (an age of 900). They distort statistics such as the mean and standard deviation and can mislead models like linear regression, k-means and k-NN.
Causes of outliers
- Data entry or measurement errors — an extra zero, wrong units, faulty sensors.
- Processing errors — bugs during merging or transformation.
- Sampling problems — data drawn from a different population.
- Natural variation — rare but real extreme values (fraud, very wealthy customers).
Types of outliers
| Type | Description | Example |
|---|---|---|
| Point (global) | One value far from all the others | Age = 250 |
| Contextual | Unusual only in a specific context | 35 °C in winter |
| Collective | A group of values that is abnormal together | A flat line in a heartbeat signal |
Why outliers matter
- They pull the mean and inflate the standard deviation.
- They skew regression lines and distance calculations.
- They ruin Min-Max scaling: one huge value squeezes all other values together.
- But sometimes they are the most valuable data, as in fraud or fault detection.
Never delete an outlier just because it is extreme. Decide based on why it is there.