How does an isolation forest detect anomalies, and why do anomalous points end up with shorter average path lengths?

Unsupervised learning, Anomaly detection
Level L1 Beginner. Length Short. Nature Th Theoretical.

What's being asked

Whether you understand that isolation forest scores points by how easily random splits separate them, not by distance or density.

Key idea

Anomalies are few and different, so a random split isolates them after few cuts; the score is based on the average path length E[h(x)] over many random trees.

Steps

  1. Build many trees. In each tree, pick a random feature and a random split value between that feature's minimum and maximum in the current node, and repeat until every point is alone (or a depth limit is reached).
  2. For a point x, the path length h(x) is the number of splits needed to isolate it in one tree. Average it over all trees to get E[h(x)].
  3. Contrast normal points and anomalies: a normal point sits inside a dense group, so many random cuts are needed to separate it from its neighbours (a long path), whereas an anomaly sits far from the rest or in a sparse region, so one or two cuts put it alone (a short path).
  4. Convert the average path length to a score between 0 and 1, where values close to 1 mean anomaly and values near 0.5 or below mean normal.
  5. No distances or density estimates are computed, and each tree uses only a small random subsample, so training is fast.

Common mistakes

How long your answer should be

4–6 sentences.

Read this

Previous in Unsupervised learning: In DBSCAN with radius ε and threshold minPts, how are a core point, a border point and a noise point defined, and how are clusters formed from them?
Next in Unsupervised learning: What is an undercomplete autoencoder, and why does it need a bottleneck narrower than the input to learn anything useful?