Course contentsShow
← Data Science
Lesson 76 of 2,1452. Descriptive Statistics FoundationsFree lesson

Deciding What to Do with Outliers

Evaluate strategies for handling outliers: investigate, remove, cap, transform, or analyze separately based on context.

Deciding What to Do with Outliers

What you'll learn: You'll discover the main strategies for handling outliers and when to apply each approach.


Finding outliers is only half the battle—deciding what to do with them requires judgment and context. There's no universal "right answer"; your choice depends on why the outlier exists and what your analysis aims to achieve.

Five Core Strategies

1. Investigate First
Always start here. Check if the outlier is a data entry error (someone typed 999 instead of 99) or measurement issue. If it's a mistake, correction or removal is justified.

2. Remove (Delete)
Appropriate when outliers are confirmed errors or irrelevant to your analysis. For example, if studying typical customer purchases, a bulk order from a wholesaler might distort your understanding of individual shoppers.

3. Cap (Winsorize)
Replace extreme values with less extreme boundaries—like setting anything above the 95th percentile equal to that percentile value. This reduces influence without losing observations entirely.

4. Transform
Apply mathematical transformations (like log or square root) to compress the scale. This can make outliers less extreme while preserving the observation's relative position. (You'll learn specific transformation techniques later.)

5. Analyze Separately
Sometimes outliers represent genuinely interesting subgroups. High-value customers or rare medical cases might deserve their own focused analysis rather than being lumped with typical cases or removed.

Context Is King

Think of outliers like unusual ingredients in a recipe. A ghost pepper in your soup might be a mistake (investigate/remove), too spicy but salvageable (cap it with milder pepper), or actually the special feature of your dish (analyze separately). The "right" choice depends on what you're cooking and who's eating.

Key Takeaway: Outlier handling requires investigating context first, then choosing among removal, capping, transformation, or separate analysis—never apply a blanket rule without understanding what the data represents.