Isolation Forest's O(log n) Secret: Random Tree Depth

Isolation Forest achieves its O(log n) computational edge by leveraging the fact that anomalies are easily isolated with fewer random splits in binary trees, placing them closer to the root. The average path length required to isolate an anomaly grows logarithmically with the number of data points, contributing to its speed.

The top 3

  1. Anomalies: Isolated Faster, Closer to Root: Isolation Forest's O(log n) efficiency stems from the fact that anomalies, being distinct and few, require significantly fewer random splits to be isolated, appearing closer to the root of the tree.
  2. Path Length: Anomaly Score's Logarithmic Basis: The anomaly score in Isolation Forest is inversely related to the average path length (number of splits) required to isolate a data point across multiple trees; shorter paths (approximating log n) indicate higher anomaly likelihood.
  3. O(log n) vs. O(n²): Speed vs. Traditional Methods: Isolation Forest achieves its O(log n) computational complexity per instance during detection, leading to 10x-100x faster performance than traditional O(n²) distance-based methods like LOF or DBSCAN, especially on large, high-dimensional datasets.

Sources

Open the full topic