Converts the trees in an SDForest object from class Node (Glur 2023) to class list. This makes it substantially easier to save the forest to disk.

# S3 method for class 'SDForest'
toList(object, ...)

Arguments

object

an SDForest object with the trees in Node format

...

Further arguments passed to or from other methods.

Value

an SDForest object with the trees in list format

References

Glur C (2023). “data.tree: General Purpose Hierarchical Data Structure.” https://CRAN.R-project.org/package=data.tree.

Author

Markus Ulmer

Examples

set.seed(1)
n <- 10
X <- matrix(rnorm(n * 5), nrow = n)
y <- sign(X[, 1]) * 3 + rnorm(n)
model <- SDForest(x = X, y = y, Q_type = 'no_deconfounding', cp = 0.5, nTree = 2)
toList(model)
#> SDForest result
#> 
#> Number of trees:  2 
#> Number of covariates:  5 
#> OOB loss:  NA 
#> OOB spectral loss:  NA