Learn R Programming

SDModels (version 1.0.10)

toList.SDForest: SDForest toList method

Description

Converts the trees in an SDForest object from class Node Glur2023Data.tree:StructureSDModels to class list. This makes it substantially easier to save the forest to disk.

Usage

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

Value

an SDForest object with the trees in list format

Arguments

object

an SDForest object with the trees in Node format

...

Further arguments passed to or from other methods.

Author

Markus Ulmer

References

See Also

fromList toList.SDTree

Examples

Run this code
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)

Run the code above in your browser using DataLab