Introduction
Gaussian mixtures detect anomalies well when the normal data form elliptical clusters. Real data are often messier: high-dimensional, oddly shaped, with clusters of different densities. scikit-learn offers several other detectors, each built on a different intuition of what makes a point "anomalous":
| Detector | Intuition |
|---|---|
| Isolation Forest | anomalies are easy to isolate with a few random cuts |
| Local Outlier Factor (LOF) | anomalies are in sparser areas than their neighbours |
| One-Class SVM | learn a boundary around the normal data; outside = anomaly |
| (also) Elliptic Envelope / Fast-MCD | fit one robust Gaussian; points far from it are outliers |
| (also) PCA reconstruction error | anomalies are badly reconstructed (topic 3.3) |
All of them follow a similar API: fit, then predict (returns +1 for normal, −1 for anomaly) and a score method (decision_function or score_samples).