Lion Cipher Lab

Detect outliers with Isolation Forest

Why it matters

Most real security data arrives with no labels. Nobody has gone through your millions of logins and marked which were attacks, so the supervised recipe (train on labeled examples) simply does not apply. Unsupervised anomaly detection is the honest tool for that world: it learns the shape of ordinary data and flags what does not fit, without ever being shown a single example of bad. Isolation Forest is one of the standard, fast, offline ways to do it, and running it on your own data once demystifies a technique that sits under a great deal of fraud, intrusion, and monitoring tooling. It also…

What you'll learn

Steps in this lab

  1. Unsupervised anomaly detection, in plain terms
  2. The intuition: anomalies are easier to isolate
  3. Install scikit-learn, offline after this
  4. Make your own small numeric dataset
  5. Fit IsolationForest and read the flags and scores
  6. Tune contamination and see the threshold move
  7. The honest limits: unsupervised is not accurate, and anomaly is not malicious
  8. What you can now do that most people can't

Open the full interactive lab →