Description Usage Arguments Value Examples
Extracts parameters from a forest made by the randomForest function
1 2 | ## S3 method for class 'randomForest'
extract_params(object, which_tree = 1, ...)
|
object |
an object of class "randomForest" |
which_tree |
the number of the tree to extract |
... |
further arguments passed to or from other methods |
a list
that is extracted from the randomForest object
1 2 3 4 5 6 | dat <- data.frame(X1 = runif(100),
X2 = rnorm(100))
dat$Y <- factor((rexp(100,5) + 5 * dat$X1 - 4 * dat$X2) > 0)
model <- randomForest::randomForest(Y ~ X1 + X2, data=dat, ntree=10)
my_tree <- extract_params(model, 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.