Detect unusual records with anomaly detection

8 steps · about 2 h 19 min · Intermediate

  1. Separate outlier and novelty detection (article, scikit-learn documentation, 18 min)

    Choose a problem formulation before comparing detector scores.

  2. Start with a transparent univariate rule (article, NIST/SEMATECH e-Handbook, 15 min)

    Use a robust exploratory test while recognising masking and distribution assumptions.

  3. Model an elliptical inlier region (reference, scikit-learn documentation, 15 min)

    Learn when a covariance-based boundary is useful and when its shape assumption is unsafe.

  4. Fit an Isolation Forest (reference, scikit-learn documentation, 20 min)

    Use random partitions to score unusual multivariate observations without a density model.

  5. Find local density anomalies (reference, scikit-learn documentation, 18 min)

    Detect points that are unusual relative to nearby observations rather than the entire dataset.

  6. Compare detector boundaries (article, scikit-learn documentation, 20 min)

    Visualise how algorithm assumptions behave on several data shapes and noise levels.

  7. Inspect Isolation Forest decisions (article, scikit-learn documentation, 15 min)

    Connect anomaly scores and a chosen threshold to the points that get flagged.

  8. Evaluate rare labelled anomalies (reference, scikit-learn documentation, 18 min)

    Use precision-recall evidence and review cost instead of accuracy on a rare-event task.