IsolationForest example
An example using IsolationForest for anomaly
detection.
The Isolation Forest is an ensemble of “Isolation Trees” that “isolate” observations by recursive random partitioning, which can be represented by a tree structure. The number of splittings required to isolate a sample is lower for outliers and higher for inliers.
In the present example we demo two ways to visualize the decision boundary of an Isolation Forest trained on a toy dataset.
# Authors: The scikit-learn developers
# SPDX-License-Identifier: BSD-3-Clause
Data generation
We generate two clusters (each one containing ) by randomly sampling the standard normal distribution as returned by . One of them is spherical and the other one is slightly deformed.


