Converts the trees in an SDForest object from
class list
to class Node
Glur2023Data.tree:StructureSDModels.
# S3 method for class 'SDForest'
fromList(object, ...)
an SDForest object with the trees in Node format
fromList
fromList.SDTree
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)
fromList(toList(model))
#> SDForest result
#>
#> Number of trees: 2
#> Number of covariates: 5
#> OOB loss: NA
#> OOB spectral loss: NA