Parsnip model specification for pptr.
pp_tree.RdCreates a model specification for a single Projection Pursuit decision tree.
Use set_engine("ppforest2") to select the ppforest2 engine.
See also
pptr for the underlying training function, pp_rand_forest for forests
Examples
# \donttest{
if (requireNamespace("parsnip", quietly = TRUE)) {
library(parsnip)
spec <- pp_tree(penalty = 0) %>% set_engine("ppforest2")
fit <- spec %>% fit(Species ~ ., data = iris)
predict(fit, iris)
}
#> # A tibble: 150 × 1
#> .pred_class
#> <fct>
#> 1 setosa
#> 2 setosa
#> 3 setosa
#> 4 setosa
#> 5 setosa
#> 6 setosa
#> 7 setosa
#> 8 setosa
#> 9 setosa
#> 10 setosa
#> # ℹ 140 more rows
# }