IF

class frlearn.data_descriptors.IF(psi: int | Callable[[int], int] = 256, t: int = 100, random_state: int = 0, preprocessors=(), **sklearn_params)[source]

Wrapper for the Isolation Forest (IF) data descriptor [1] implemented in scikit-learn. Expresses the effort required to isolate a query instance from the target data by random splits on attribute values.

Parameters
psiint or (int -> int) = 256

Sub-sampling size. Number of training instances to use for each random tree. Should be either a positive integer, or a function that takes the size of the target class and returns such an integer. If the size of the target class is a smaller number, that will be used instead.

tint = 100

Number of random trees.

random_stateint = 0

Random state to use.

preprocessorsiterable = ()

Preprocessors to apply.

sklearn_params

Additional keyword parameters will be passed on as-is to scikit-learn’s IsolationForest constructor.

Notes

Scores are the complement of the anomaly scores in [1]. psi and t are two hyperparameters that can potentially be tuned, but the default values should be good enough [1].

References

1(1,2,3)

Liu FT, Ting KM, Zhou Z-H (2008). Isolation Forest. ICDM 2008: Proceedings of the Eighth IEEE International Conference on Data Mining, pp 413–422. IEEE. doi: 10.1109/ICDM.2008.17

class Model[source]

Examples using frlearn.data_descriptors.IF