Skip to contents

Creates a model specification for a Projection Pursuit random forest. Use set_engine("ppforest2") to select the ppforest2 engine.

Usage

pp_rand_forest(
  mode = "classification",
  trees = NULL,
  mtry = NULL,
  penalty = NULL
)

Arguments

mode

A character string for the model type. Only "classification" is supported.

trees

The number of trees in the forest (maps to size).

mtry

The number of variables to consider at each split (maps to n_vars).

penalty

The regularization parameter (maps to lambda).

Value

A parsnip model specification.

See also

pprf for the underlying training function, pp_tree for single trees

Examples

if (FALSE) { # \dontrun{
library(parsnip)
spec <- pp_rand_forest(trees = 50, mtry = 2) %>% set_engine("ppforest2")
fit <- spec %>% fit(Type ~ ., data = iris)
predict(fit, iris)
predict(fit, iris, type = "prob")
} # }