eif: Extended Isolation Forest

Description Usage Arguments Value References Examples

View source: R/eif.R

Description

The eif function is an R wrapper around the original Python implementation of the Extended Isolation Forest (Hariri, Kind, Brunner (2018) <arXiv:1811.02141>) algorithm for anomaly detection, developed by the original authors of the paper. This extension improves the consistency and reliability of anomaly scores produced by the standard Isolation Forest (Liu, Ting, Zhou (2008) <doi:10.1109/ICDM.2008.17>). Extended Isolation Forests allows for the slicing of the data to be carried out using hyperplanes with random slopes which results in improved score maps.

Usage

1
eif(X, ntrees, sample_size, ExtensionLevel)

Arguments

X

(matrix) A numeric data matrix.

ntrees

(integer) Number of trees to be used in fitting the forest.

sample_size

(integer) Number of rows to be sub-sampled in creating each tree. This must be less than the number of observations in the dataset.

ExtensionLevel

(integer) Degrees of freedom in choosing the hyperplanes for dividing up the data. This must be less than the dimension of the dataset. Setting ExtensionLevel = 0 will allow you to fit a standard isolation forest.

Value

A named list of length two containing the isolation forest (in iforest) and anomaly scores (in scores).

References

Examples

1
2
3
4
## Not run: 
eif(as.matrix(mtcars), ntrees = 10L, sample_size = 5L, ExtensionLevel = 1L)

## End(Not run)

ergodiclife/eif documentation built on Oct. 26, 2021, 2:09 p.m.