<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/what-are-outliers-and-how-do-you-detect-and-treat-them--ve0ucfi4b" -->

---
title: What are outliers, and how do you detect and treat them?
description: Outliers are data points that deviate significantly from the rest of a dataset and can arise from errors or rare events. Detection methods covered include...
canonical: https://daily.dev/posts/what-are-outliers-and-how-do-you-detect-and-treat-them--ve0ucfi4b
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: What are outliers, and how do you detect and treat them? | daily.dev
og:description: Outliers are data points that deviate significantly from the rest of a dataset and can arise from errors or rare events. Detection methods covered include...
og:url: https://daily.dev/posts/what-are-outliers-and-how-do-you-detect-and-treat-them--ve0ucfi4b
og:image: https://api.daily.dev/og/posts/ve0UcFi4b.png
og:image:alt: What are outliers, and how do you detect and treat them?
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# What are outliers, and how do you detect and treat them?

**[Medium](https://daily.dev/sources/medium_js)** · 2 min read · 0 upvotes · 0 comments

## Summary

Outliers are data points that deviate significantly from the rest of a dataset and can arise from errors or rare events. Detection methods covered include visual tools (box plots, scatter plots, histograms), statistical approaches (IQR method, Z-score, Modified Z-score), and ML-based techniques (Isolation Forest, LOF, One-Class SVM, DBSCAN). Treatment strategies range from removing erroneous outliers and imputing with mean/median/mode, to Winsorization, data transformations (log, square root, Box-Cox), robust scaling, and using outlier-resistant models like Random Forest or XGBoost.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://medium.com/@akdkeerthi2001/what-are-outliers-and-how-do-you-detect-and-treat-them-cb968e5677db>

## Questions this post answers

### What is the IQR method for detecting outliers?

The interquartile range method flags a value as an outlier when it falls below Q1 minus 1.5 times the IQR or above Q3 plus 1.5 times the IQR, where IQR equals Q3 minus Q1. It relies only on the first and third quartiles, making it robust to extreme skew compared to methods based on the mean and standard deviation.

_daily.dev surfaces practical explanations like this for developers building out their data preprocessing skills._

### What Z-score threshold is typically used to identify an outlier?

A value is usually treated as an outlier when its absolute Z-score exceeds 3, meaning it sits more than three standard deviations from the mean. For skewed data, a modified Z-score based on the median absolute deviation is recommended instead, since the standard Z-score assumes a roughly normal distribution.

_Developers comparing outlier detection techniques can find grounded explanations like this through daily.dev._

### How do you treat outliers without removing them entirely?

Winsorization caps extreme values at selected percentiles rather than deleting them, and Robust Scaler rescales data using the median and IQR instead of the mean and standard deviation. Alternatively, choosing models less sensitive to extreme values, such as Random Forest or XGBoost, avoids needing to modify the data at all.

_daily.dev helps developers weighing outlier treatment strategies find concrete techniques to compare._

## Similar posts on daily.dev

- [How to Detect and Handle Outliers in Python](https://daily.dev/posts/how-to-detect-and-handle-outliers-in-python-9lb3li1la) · Medium · 0 upvotes · 0 comments
- [The Machine Learning “Advent Calendar” Day 8: Isolation Forest in Excel](https://daily.dev/posts/the-machine-learning-advent-calendar-day-8-isolation-forest-in-excel-70giwwuwg) · Towards Data Science · 0 upvotes · 0 comments
- [Real-time anomaly detection: algorithms, use cases & SQL code](https://daily.dev/posts/real-time-anomaly-detection-algorithms-use-cases-sql-code-hn97tdhe4) · Tinybird · 0 upvotes · 0 comments
- [6 Best Practices for Your Anomaly Detection Platform Success](https://daily.dev/posts/6-best-practices-for-your-anomaly-detection-platform-success-d480tllja) · Decube · 0 upvotes · 0 comments

---

Tags: [#machine-learning](https://daily.dev/tags/machine-learning), [#data-analysis](https://daily.dev/tags/data-analysis), [#statistics](https://daily.dev/tags/statistics)

[View this post on daily.dev](https://daily.dev/posts/what-are-outliers-and-how-do-you-detect-and-treat-them--ve0ucfi4b)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"What are outliers, and how do you detect and treat them?","url":"https://daily.dev/posts/what-are-outliers-and-how-do-you-detect-and-treat-them--ve0ucfi4b","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/what-are-outliers-and-how-do-you-detect-and-treat-them--ve0ucfi4b"},"datePublished":"2026-07-23T05:35:44.226Z","dateModified":"2026-09-13T21:42:06.658Z","description":"Outliers are data points that deviate significantly from the rest of a dataset and can arise from errors or rare events. Detection methods covered include...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/23354ca2822aa6c4c2540b7669f4d2a1?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/23354ca2822aa6c4c2540b7669f4d2a1?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Medium","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Medium","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/medium","url":"https://daily.dev/sources/medium_js"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/what-are-outliers-and-how-do-you-detect-and-treat-them--ve0ucfi4b","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"machine-learning,data-analysis,statistics","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Medium","item":"https://daily.dev/sources/medium_js"},{"@type":"ListItem","position":3,"name":"What are outliers, and how do you detect and treat them?"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/what-are-outliers-and-how-do-you-detect-and-treat-them--ve0ucfi4b#faq","mainEntity":[{"@type":"Question","name":"What is the IQR method for detecting outliers?","acceptedAnswer":{"@type":"Answer","text":"The interquartile range method flags a value as an outlier when it falls below Q1 minus 1.5 times the IQR or above Q3 plus 1.5 times the IQR, where IQR equals Q3 minus Q1. It relies only on the first and third quartiles, making it robust to extreme skew compared to methods based on the mean and standard deviation. daily.dev surfaces practical explanations like this for developers building out their data preprocessing skills."}},{"@type":"Question","name":"What Z-score threshold is typically used to identify an outlier?","acceptedAnswer":{"@type":"Answer","text":"A value is usually treated as an outlier when its absolute Z-score exceeds 3, meaning it sits more than three standard deviations from the mean. For skewed data, a modified Z-score based on the median absolute deviation is recommended instead, since the standard Z-score assumes a roughly normal distribution. Developers comparing outlier detection techniques can find grounded explanations like this through daily.dev."}},{"@type":"Question","name":"How do you treat outliers without removing them entirely?","acceptedAnswer":{"@type":"Answer","text":"Winsorization caps extreme values at selected percentiles rather than deleting them, and Robust Scaler rescales data using the median and IQR instead of the mean and standard deviation. Alternatively, choosing models less sensitive to extreme values, such as Random Forest or XGBoost, avoids needing to modify the data at all. daily.dev helps developers weighing outlier treatment strategies find concrete techniques to compare."}}]}
```

