Data Analysis✓ Mathematical
◆ The PatternIQR, Z-score, Isolation Forest — finding extreme values and knowing when they're the signal
Outliers can be errors to fix or signal to keep. Z-score flags points far from the mean, IQR is robust to skew, and Isolation Forest catches complex multi-dimensional outliers that univariate methods miss.
IQR method: outlier if x < Q1 − 1.5·IQR or x > Q3 + 1.5·IQR
IQR = Q3 − Q1 (interquartile range). Robust to skewed distributions.
Z = (x − μ) / σ outlier if |Z| > 3
Z-score = standard deviations from mean. Assumes roughly normal data.
// Interactive — scattered points with outlier detection zones
Method
Outliers—
# Python — outlier detection from sklearn.ensemble import IsolationForest import numpy as np # IQR method Q1, Q3 = np.percentile(data, [25, 75]) IQR = Q3 - Q1 mask = (data < Q1 - 1.5*IQR) | (data > Q3 + 1.5*IQR) # Isolation Forest — multi-dimensional iso = IsolationForest(contamination=0.05) labels = iso.fit_predict(X) # -1 = outlier
Pattern bridge: In markets, outliers are black swan events — the crash days that break every model. In fraud detection, the outliers are the target. Context decides whether to remove or study them.