isotree.build.indexer: Build Indexer for Faster Terminal Node Predictions and/or...

View source: R/isoforest.R

isotree.build.indexerR Documentation

Build Indexer for Faster Terminal Node Predictions and/or Distance Calculations

Description

Builds an index of terminal nodes for faster prediction of terminal node numbers (calling 'predict' with 'type="tree_num"').

Optionally, can also pre-calculate terminal node distances in order to speed up distance calculations (calling 'predict' with 'type="dist"' or 'type="avg_sep"').

Usage

isotree.build.indexer(model, with_distances = FALSE, nthreads = model$nthreads)

Arguments

model

An Isolation Forest model (as returned by function isolation.forest) for which an indexer for terminal node numbers and/or distances will be added.

The object will be modified in-place.

with_distances

Whether to also pre-calculate node distances in order to speed up 'predict' with 'type="dist"' or 'type="avg_sep"'. Note that this will consume a lot more memory and make the resulting object significantly heavier.

nthreads

Number of parallel threads to use.

Details

This feature is not available for models that use 'missing_action="divide"' or 'new_categ_action="weighted"' (which are the defaults when passing 'ndim=1').

Value

The same 'model' object (as invisible), but now with an indexer added to it. Note the input object is modified in-place regardless.

See Also

isotree.drop.indexer


isotree documentation built on May 29, 2024, 11:24 a.m.