Purification makes the components of the forest's functional decomposition
unique, which predict_components() relies on. Unless rpf() was called
with purify = TRUE, predict_components() purifies the forest on first
use.
Arguments
- x
[rpf]: A fittedrpfmodel.- ...
Reserved for future expansion.
- maxp_interaction
[integer(1) | NULL: NULL]: Highest interaction order to purify. Higher-order components are set to zero, but still influence lower orders during purification, andpredict_components()then returns zero for them.NULLpurifies all orders.- mode
[integer(1): 2]: Purification algorithm:2is the fast exact KD-tree based algorithm,1the original grid-based one.- nthreads
[integer(1) | NULL: NULL]: Number of threads.NULLuses thenthreadsthe forest was fitted with, capped at the available cores.
Details
The forest is modified in place: x and every copy of it are purified,
whether or not the result is assigned.
purify() is idempotent, meaning if the forest is already purified it just returns it unmodified.
Examples
rpfit <- rpf(mpg ~ ., data = mtcars, max_interaction = 2, ntrees = 10)
is_purified(rpfit)
#> [1] FALSE
purify(rpfit)
is_purified(rpfit)
#> [1] TRUE