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"`).
isotree.build.indexer(model, with_distances = FALSE)
The same `model` object (as invisible), but now with an indexer added to it. Note the input object is modified in-place regardless.
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.
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.
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`).
isotree.drop.indexer