| pp_tree | R Documentation |
Creates a model specification for a single Projection Pursuit decision tree.
Use set_engine("ppforest2") to select the ppforest2 engine.
pp_tree(mode = "classification", penalty = NULL)
mode |
A character string for the model type. Either |
penalty |
The regularization parameter (maps to |
A parsnip model specification.
pptr for the underlying training function, pp_rand_forest for forests
if (requireNamespace("parsnip", quietly = TRUE)) {
library(parsnip)
spec <- pp_tree(penalty = 0) %>% set_engine("ppforest2")
fit <- spec %>% fit(Species ~ ., data = iris)
predict(fit, iris)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.