copy.SDForest: Copy a forest

View source: R/copy.R

copy.SDForestR Documentation

Copy a forest

Description

Returns a copy of the forest object. Might be useful if you want to keep the original forest in comparison to the pruned forest.

Usage

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

Arguments

object

an SDForest object

...

Further arguments passed to or from other methods.

Value

A copy of the SDForest object

Author(s)

Markus Ulmer

See Also

prune

Examples


set.seed(1)
X <- matrix(rnorm(10 * 20), nrow = 10)
Y <- rnorm(10)
fit <- SDForest(x = X, y = Y, nTree = 2, cp = 0.5)
fit2 <- copy(fit)

SDModels documentation built on April 11, 2025, 5:50 p.m.