r descr_models("bag_tree", "rpart")

Tuning Parameters

defaults <- 
  tibble::tibble(parsnip = c("tree_depth", "min_n", "cost_complexity", "class_cost"),
                 default = c("30L", "2L", "0.01", "(see below)"))

param <-
 bag_tree() %>% 
  set_engine("rpart") %>% 
  set_mode("regression") %>% 
  make_parameter_list(defaults)

This model has r nrow(param) tuning parameters:

param$item

For the class_cost parameter, the value can be a non-negative scalar for a class cost (where a cost of 1 means no extra cost). This is useful for when the first level of the outcome factor is the minority class. If this is not the case, values between zero and one can be used to bias to the second level of the factor.

Translation from parsnip to the original package (classification)

r uses_extension("bag_tree", "rpart", "classification")

library(baguette)

bag_tree(tree_depth = integer(1), min_n = integer(1), cost_complexity = double(1)) %>% 
  set_engine("rpart") %>% 
  set_mode("classification") %>% 
  translate()

Translation from parsnip to the original package (regression)

r uses_extension("bag_tree", "rpart", "regression")

library(baguette)

bag_tree(tree_depth = integer(1), min_n = integer(1), cost_complexity = double(1)) %>% 
  set_engine("rpart") %>% 
  set_mode("regression") %>% 
  translate()

Translation from parsnip to the original package (censored regression)

r uses_extension("bag_tree", "rpart", "censored regression")

library(censored)

bag_tree(tree_depth = integer(1), min_n = integer(1), cost_complexity = double(1)) %>% 
  set_engine("rpart") %>% 
  set_mode("censored regression") %>% 
  translate()

Preprocessing requirements


Case weights


Other details


References



Try the parsnip package in your browser

Any scripts or data that you put into this service are public.

parsnip documentation built on Aug. 18, 2023, 1:07 a.m.