Evaluating isolation trees

Share:

Description

Return anomaly scores and path length of x according to forest.

Usage

1
       AnomalyScore(x, forest, ntree = forest$ntree, hlim = forest$hlim, appRange = F)

Arguments

x

a data frame of samples

forest

an object generated by IsolationTrees()

ntree

specifies the number of trees used to find the anomaly score, must be greater than 0 and smaller or equal to number of tree used in the model

hlim

evaluation tree height limit

appRange

boolean switch to apply application range

Details

AnomalyScore passes each sample in x through forest to obtain expected path length. It then uses path length and parameter in forest to determine anomaly score.

Value

outF

anomaly scores of samples in x

pathLength

average path lengths of samples in x

Author(s)

Fei Tony Liu

References

Fei Tony Liu, Kai Ming Ting, and Zhi-Hua Zhou
Isolation Forest
IEEE International Conference on Data Mining 2008 (ICDM 08), Pisa, Italy, 2008. http://www.gscit.monash.edu.au/gscitweb/loid.php?loid=905282&mimetype=application/pdf

See Also

IsolationTrees

Examples

1
2
3
4
5
6
7
8
library(IsolationForest)
data(stackloss)
# train a model of Isolation Forest
tr<-IsolationTrees(stackloss,rFactor=0)
#evaluate anomaly score
as<-AnomalyScore(stackloss,tr)
# show anomaly score
as$outF

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.