Something like decision_tree() doesn't do any type checking, where we can at least check for numeric input and sensible ranges without getting opinionated
library(parsnip)
data(hpc_data, package = "modeldata")
bt <- decision_tree(tree_depth = c(1, 5, 10)) %>%
set_engine("rpart") %>%
set_mode("classification")
fit(bt, class ~ ., hpc_data)
#> Error in if (maxdepth > 30L) stop("Maximum depth is 30"): the condition has length > 1
Something like
decision_tree()
doesn't do any type checking, where we can at least check for numeric input and sensible ranges without getting opinionatedCreated on 2024-04-01 with reprex v2.1.0