library(isotree)
data(mtcars)
model <- isolation.forest(mtcars, ntrees = 10, nthreads = 1, ndim = 1)
model_shallow_copy <- model
isotree.is.same(model, model_shallow_copy)
model_deep_copy <- isotree.deep.copy(model)
isotree.is.same(model, model_deep_copy)
isotree.add.tree(model_shallow_copy, mtcars)
length(isotree.get.num.nodes(model_shallow_copy)$total)
length(isotree.get.num.nodes(model)$total)
length(isotree.get.num.nodes(model_deep_copy)$total)
Run the code above in your browser using DataLab