IQR, Z-score, Isolation Forest, LOF — how do you pick an outlier detection method?
mediumAnswer
- IQR: 1.5 * IQR beyond Q1/Q3 — robust univariate baseline, great for a quick 'known distribution' check.
- Z-score : assumes Gaussian, sensitive to the very outliers you want to find.
- Isolation Forest: randomly partitions space; outliers get isolated in few splits — scalable to large + high-dim, model-agnostic, the default for multivariate anomaly detection.
- LOF (Local Outlier Factor): compares local density to that of neighbours — good when outliers live in low-density regions of a heterogenous distribution.
- Rule of thumb: IsolationForest for tabular multivariate, IQR for quick univariate sanity checks.
Check yourself — multiple choice
- Only IQR works
- IQR / Z-score for univariate; Isolation Forest for multivariate at scale; LOF for local-density outliers
- Isolation Forest is only for time series
- LOF requires labels
Match method to data shape: IQR (univariate), IsolationForest (multivariate scale), LOF (local density).
#outliers
Practise Supervised Learning
215 interview questions in this topic.