regPath.SDForest | R Documentation |
This function calculates the variable importance of an SDForest and the out-of-bag performance for different complexity parameters.
## S3 method for class 'SDForest'
regPath(object, cp_seq = NULL, X = NULL, Y = NULL, Q = NULL, copy = TRUE, ...)
object |
an SDForest object |
cp_seq |
A sequence of complexity parameters. If NULL, the sequence is calculated automatically using only relevant values. |
X |
The training data, if NULL the data from the forest object is used. |
Y |
The training response variable, if NULL the data from the forest object is used. |
Q |
The transformation matrix, if NULL the data from the forest object is used. |
copy |
Whether the tree should be copied for the regularization path. If FALSE, the pruning is done in place and will change the SDForest. This might be reasonable, if the SDForest is to large to copy. |
... |
Further arguments passed to or from other methods. |
An object of class paths
containing
cp |
The sequence of complexity parameters. |
varImp_path |
A |
loss_path |
A |
cp_min |
The complexity parameter with the lowest out-of-bag performance. |
type |
Path type |
Markus Ulmer
plot.paths
plotOOB
regPath.SDTree
prune
get_cp_seq
SDForest
set.seed(1)
n <- 10
X <- matrix(rnorm(n * 5), nrow = n)
y <- sign(X[, 1]) * 3 + sign(X[, 2]) + rnorm(n)
model <- SDForest(x = X, y = y, Q_type = 'no_deconfounding', cp = 0.5)
paths <- regPath(model)
plotOOB(paths)
plot(paths)
plot(paths, plotly = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.