Course Content
Data Anomaly Detection
Data Anomaly Detection
1.5 IQR Rule
The 1.5 IQR (Interquartile Range) rule is a simple but effective method for identifying outliers in a dataset. It's based on the spread of data around the median and is commonly used in anomaly detection.
How to use 1.5 IQR rule
- Calculate the IQR, which is the range between the 75th percentile (Q3) and the 25th percentile (Q1) of the dataset;
- Define the lower threshold as
Q1 - 1.5 * IQR
and the upper threshold asQ3 + 1.5 * IQR
; - Any data point below the lower threshold or above the upper threshold is considered an outlier.
Here is the implementation of this rule:
We simply calculate threshold values and condenser all points out of IQR range as outliers.
1.5 IQR rule for commonly used distributions
Pros and cons of using 1.5 IQR rule
Thanks for your feedback!