isotree.drop.indexer: Drop Indexer Sub-Object from Isolation Forest Model Object

View source: R/isoforest.R

isotree.drop.indexerR Documentation

Drop Indexer Sub-Object from Isolation Forest Model Object

Description

Drops the indexer sub-object from an isolation forest model object, if it was constructed. The indexer, if constructed, is likely to be a very heavy object which might not be needed for all purposes.

Usage

isotree.drop.indexer(model, manually_delete_cpp = TRUE)

Arguments

model

An 'isolation_forest' model object.

manually_delete_cpp

Whether to manually delete the underlying C++ object after calling this function.

If passing ‘FALSE', memory will not be freed until the underlying R ’externalptr' object is garbage-collected, which typically happens after the next call to 'gc()'.

If passing ‘TRUE', will manually delete the C++ object held in the ’externalptr' object before nullifying it. Note that, if somehow one assigned the pointer address to some other R variable through e.g. a deep copy of the 'externalptr' object (that happened without copying the full model object where this R variable is stored), then other pointers pointing at the same address might trigger crashes at the moment they are used.

Note that, unless one starts manually fiddling with the internals of model objects and assigning variables to/from them, it should not be possible to end up in a situation in which an 'externalptr' object ends up deep-copied, especially when using 'lazy_serialization=TRUE'.

Details

Note that reference points as added through isotree.set.reference.points are associated with the indexer object and will also be dropped if any were added.

Value

The same 'model' object, but now with the indexer removed. Note that 'model' is modified in-place in any event.

See Also

isotree.build.indexer


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