| pp_rand_forest | R Documentation |
Creates a model specification for a Projection Pursuit random forest.
Use set_engine("ppforest2") to select the ppforest2 engine.
pp_rand_forest(
mode = "classification",
trees = NULL,
mtry = NULL,
mtry_prop = NULL,
penalty = NULL
)
mode |
A character string for the model type. Either |
trees |
The number of trees in the forest (maps to |
mtry |
The number of variables to consider at each split (maps to |
mtry_prop |
The proportion of variables to consider at each split (maps to |
penalty |
The regularization parameter (maps to |
A parsnip model specification.
pprf for the underlying training function, pp_tree for single trees
if (requireNamespace("parsnip", quietly = TRUE)) {
library(parsnip)
spec <- pp_rand_forest(trees = 50, mtry = 2) %>% set_engine("ppforest2")
fit <- spec %>% fit(Species ~ ., data = iris)
predict(fit, iris)
predict(fit, iris, type = "prob")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.