Skip to content

Clustering, density estimation, and anomaly detection · Anomaly detection · UCL049 · Algorithm

Extended Isolation Forest

Reduce axis-aligned artifacts of Isolation Forest by splitting with randomly oriented hyperplanes. Useful when directional geometry makes axis-aligned isolation produce inconsistent anomaly contours.

Runs in CodeSplash Component demo, not a trained model CodeSplash's run and the reference's record

In CodeSplash

A CodeSplash method runs this entry in Python and R. Set it up from the method's page.

Do it in CodeSplash Run it on your own data, in Python or R.

Availability
Runs in CodeSplash
Code example
Component demo, not a trained model
Who ran it
CodeSplash's run and the reference's record
CodeSplash's run
Verified in Python and R through discover.iforest. The reference's example ran here in one language.
The reference's record
Python: Ran in the reference's review. The report doesn't record which version of the code ran. R: Reviewed but not run: R wasn't available to the reference's authors.

Purpose

Reduce axis-aligned artifacts of Isolation Forest by splitting with randomly oriented hyperplanes. Useful when directional geometry makes axis-aligned isolation produce inconsistent anomaly contours.

Question / hypotheses

Which observations deviate from the chosen reference notion of normality, and at what operational alert rate? This entry defines an estimation or optimization objective, not an intrinsic null/alternative hypothesis test.

Architecture / computational structure

An ensemble of random hyperplane trees instead of axis-aligned trees.

Assumptions

Full extension is not universally better; scaling and irrelevant dimensions still affect random hyperplanes. Hyperplane splitting reduces a particular geometric artifact but does not guarantee reliable density estimation or calibrated anomaly probability.

Formula / computational definition

A split sends xx left or right according to (x−p)Tn≤0(x-p)^Tn\le0, where pp is a sampled intercept point and nn a random normal vector. Extension level controls how many coordinates participate; path-length normalization follows the isolation principle.

Parameters and notation

Learned or fitted quantities: Hyperplane normals/intercepts, tree structure, and threshold. User-set hyperparameters/design choices: Choose extension level, tree count, subsample size, height limit, and random seed. Tune these against the stated objective and stability/validation criteria; do not select settings on the final evaluation set.

Fitting, fine-tuning, and adaptation

Neural fine-tuning is not applicable to this classical detector. Refit the reference model when its population changes, then recalibrate an alert threshold on a separate normal holdout. Tune sensitivity without using final-test anomaly labels repeatedly.

How to use and calibrate

Compare score contours on rotated data, stability over seeds, and performance at a fixed false-alarm budget against ordinary Isolation Forest. Keep train/test splits and score orientation consistent.

Example application

Reduce orientation artifacts when screening multivariate measurement anomalies. Define the reference population, measurement units, and success criterion before fitting; investigate whether discovered groups or alerts reflect the intended phenomenon.

Interpretation / pitfalls

Watch out

The reported result is conditional on the representation and objective. An alert is a screening result, not a diagnosis or a calibrated posterior probability. Evaluate both ranking and the decision threshold.

Python and R code examples

The authors' sahandha/eif repository provides Python code. R can bridge to that implementation or implement hyperplane trees explicitly. The paired component demonstrates a single oriented split; building a forest requires recursive subsampling, path lengths, and terminal-node corrections.

Component: One extended-isolation hyperplane split. Python: executed successfully; R: not executed (Rscript unavailable). These small fixtures establish the arithmetic operation, not full-method accuracy or reproduction of paper results.

Python and R

The reference's own programs, shown as written. A component demo shows one central piece of the method; it doesn't train a full model.

Python

Component demo, not a trained model — One extended-isolation hyperplane split. · needs numpy

import numpy as np
X=np.array([[0.,0.],[1.,2.],[3.,1.]]); point=np.array([1.,1.]); normal=np.array([.6,.8])
result=(X-point)@normal<=0
print(result)
R

Component demo, not a trained model — One extended-isolation hyperplane split.

X=rbind(c(0,0),c(1,2),c(3,1)); point=c(1,1); normal=c(.6,.8)
result=as.vector(sweep(X,2,point)%*%normal)<=0
print(result)

Sources

From the CodeSplash reference, entry UCL049.