diff --git a/DESCRIPTION b/DESCRIPTION index 5dbad07..3703e80 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -4,7 +4,7 @@ Version: 0.2.0.9000 Authors@R: c( person("Max", "Kuhn", , "max@posit.co", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-2402-136X")), - person(given = "Posit Software, PBC", role = c("cph", "fnd")) + person("Posit Software, PBC", role = c("cph", "fnd")) ) Description: Code snippets to fit models using the tidymodels framework can be easily created for a given data set. @@ -13,7 +13,7 @@ URL: https://usemodels.tidymodels.org/, https://github.com/tidymodels/usemodels BugReports: https://github.com/tidymodels/usemodels/issues Depends: - R (>= 3.4) + R (>= 4.1) Imports: cli, clipr, @@ -28,8 +28,7 @@ Suggests: modeldata, spelling, testthat -Config/Needs/website: - tidyverse/tidytemplate +Config/Needs/website: tidyverse/tidytemplate Config/testthat/edition: 3 Encoding: UTF-8 Language: en-US diff --git a/NAMESPACE b/NAMESPACE index 964dc30..e060dbf 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -22,6 +22,5 @@ import(tune) importFrom(dplyr,one_of) importFrom(dplyr,pull) importFrom(dplyr,select) -importFrom(recipes,"%>%") importFrom(recipes,all_predictors) importFrom(recipes,recipe) diff --git a/NEWS.md b/NEWS.md index daf65f3..e44f5f4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,10 +1,11 @@ # usemodels (development version) +* Transition from the magrittr pipe to the base R pipe. + * Added `use_nnet()`, `use_rpart()`, `use_bag_tree_rpart()`, `use_mgcv()`, `use_dbarts()`, `use_mixOmics()`, `use_xrf()`. * Fix `recipe()` call when `clipboard = TRUE` - # usemodels 0.2.0 * SVM (#14) and C5.0 (#9) models were added. diff --git a/R/misc.R b/R/misc.R index 3493de4..fde84ae 100644 --- a/R/misc.R +++ b/R/misc.R @@ -20,8 +20,8 @@ y_lvl <- function(rec) { } var_roles <- summary(rec) y_cols <- var_roles$variable[var_roles$role == "outcome"] - y_dat <- rec$template %>% - dplyr::select(one_of(y_cols)) %>% + y_dat <- rec$template |> + dplyr::select(one_of(y_cols)) |> dplyr::pull(1) length(levels(y_dat)) } @@ -57,14 +57,14 @@ chr_assign <- function(name, value, cr = TRUE) { res } pipe_value <- function(base, value) { - # Find last non-comment line, add a `%>%` to the end, then add another line + # Find last non-comment line, add a `|>` to the end, then add another line value <- rlang::enexpr(value) value <- rlang::expr_text(value, width = expr_width) clean_base <- gsub("\\n", "", base) clean_base <- trimws(base, which = "left") not_comment <- seq_along(base)[!grepl("## ", clean_base)] n <- max(1, max(not_comment)) - base[n] <- paste(base[n], "%>%") + base[n] <- paste(base[n], "|>") c(base, paste0("\n ", value)) } add_comment <- function(base, value, add = TRUE, colors = TRUE) { @@ -84,22 +84,22 @@ add_comment <- function(base, value, add = TRUE, colors = TRUE) { res } add_steps_dummy_vars <- function(base, hot = FALSE, add = FALSE, colors = TRUE) { - base <- base %>% + base <- base |> pipe_value(step_novel(all_nominal_predictors())) if (hot) { - base <- base %>% - add_comment(dummy_hot_msg, add, colors = colors) %>% + base <- base |> + add_comment(dummy_hot_msg, add, colors = colors) |> pipe_value(step_dummy(all_nominal_predictors(), one_hot = TRUE)) } else { - base <- base %>% - add_comment(dummy_msg, add, colors = colors) %>% + base <- base |> + add_comment(dummy_msg, add, colors = colors) |> pipe_value(step_dummy(all_nominal_predictors())) } base } add_steps_normalization <- function(base) { - base %>% - pipe_value(step_zv(all_predictors())) %>% + base |> + pipe_value(step_zv(all_predictors())) |> pipe_value(step_normalize(all_numeric_predictors())) } factor_check <- function(base, rec, add, colors = TRUE) { @@ -107,15 +107,15 @@ factor_check <- function(base, rec, add, colors = TRUE) { nominal <- var_roles$variable[var_roles$type == "nominal"] is_str <- purrr::map_lgl( - rec$template %>% dplyr::select(dplyr::one_of(nominal)), + rec$template |> dplyr::select(dplyr::one_of(nominal)), rlang::is_character ) if (any(is_str)) { selector <- rlang::expr(one_of(!!!nominal[is_str])) step_expr <- rlang::expr(step_string2factor(!!selector)) base <- - base %>% - add_comment(string_to_factor_msg, add = add, colors = colors) %>% + base |> + add_comment(string_to_factor_msg, add = add, colors = colors) |> pipe_value(!!step_expr) } base @@ -135,9 +135,9 @@ top_level_comment <- function(..., add = FALSE, colors = TRUE) { } template_workflow <- function(prefix) { - paste0(prefix, "_workflow") %>% - assign_value(workflow()) %>% - pipe_value(add_recipe(!!rlang::sym(paste0(prefix, "_recipe")))) %>% + paste0(prefix, "_workflow") |> + assign_value(workflow()) |> + pipe_value(add_recipe(!!rlang::sym(paste0(prefix, "_recipe")))) |> pipe_value(add_model(!!rlang::sym(paste0(prefix, "_spec")))) } diff --git a/R/use.R b/R/use.R index 878d0b4..29a0b10 100644 --- a/R/use.R +++ b/R/use.R @@ -48,13 +48,13 @@ use_glmnet <- function(formula, data, prefix = "glmnet", verbose = FALSE, rec_cl <- initial_recipe_call(match.call()) rec_syntax <- - paste0(prefix, "_recipe") %>% + paste0(prefix, "_recipe") |> assign_value(!!rec_cl) rec <- recipes::recipe(formula, data) rec_syntax <- - rec_syntax %>% + rec_syntax |> factor_check(rec, add = verbose, colors = colors) if (has_factor_pred(rec)) { @@ -62,8 +62,8 @@ use_glmnet <- function(formula, data, prefix = "glmnet", verbose = FALSE, add_steps_dummy_vars(rec_syntax, add = verbose, colors = colors) } rec_syntax <- - rec_syntax %>% - add_comment(paste(reg_msg, zv_msg), add = verbose, colors = colors) %>% + rec_syntax |> + add_comment(paste(reg_msg, zv_msg), add = verbose, colors = colors) |> add_steps_normalization() mod_mode <- model_mode(rec) @@ -78,24 +78,24 @@ use_glmnet <- function(formula, data, prefix = "glmnet", verbose = FALSE, num_lvl <- y_lvl(rec) if (num_lvl == 2) { mod_syntax <- - paste0(prefix, "_spec") %>% - assign_value(!!rlang::call2("logistic_reg", !!!prm)) %>% + paste0(prefix, "_spec") |> + assign_value(!!rlang::call2("logistic_reg", !!!prm)) |> pipe_value(set_mode("classification")) } else { mod_syntax <- - paste0(prefix, "_spec") %>% - assign_value(!!rlang::call2("multinom_reg", !!!prm)) %>% + paste0(prefix, "_spec") |> + assign_value(!!rlang::call2("multinom_reg", !!!prm)) |> pipe_value(set_mode("classification")) } } else { mod_syntax <- - paste0(prefix, "_spec") %>% - assign_value(!!rlang::call2("linear_reg", !!!prm)) %>% + paste0(prefix, "_spec") |> + assign_value(!!rlang::call2("linear_reg", !!!prm)) |> pipe_value(set_mode("regression")) } mod_syntax <- - mod_syntax %>% + mod_syntax |> pipe_value(set_engine("glmnet")) route(rec_syntax, path = pth) @@ -129,13 +129,13 @@ use_xgboost <- function(formula, data, prefix = "xgboost", verbose = FALSE, rec_cl <- initial_recipe_call(match.call()) rec_syntax <- - paste0(prefix, "_recipe") %>% + paste0(prefix, "_recipe") |> assign_value(!!rec_cl) rec <- recipe(formula, data) rec_syntax <- - rec_syntax %>% + rec_syntax |> factor_check(rec, add = verbose, colors = colors) if (has_factor_pred(rec)) { @@ -161,9 +161,9 @@ use_xgboost <- function(formula, data, prefix = "xgboost", verbose = FALSE, } mod_syntax <- - paste0(prefix, "_spec") %>% - assign_value(!!rlang::call2("boost_tree", !!!prm)) %>% - pipe_value(set_mode(!!model_mode(rec))) %>% + paste0(prefix, "_spec") |> + assign_value(!!rlang::call2("boost_tree", !!!prm)) |> + pipe_value(set_mode(!!model_mode(rec))) |> pipe_value(set_engine("xgboost")) route(rec_syntax, path = pth) @@ -189,13 +189,13 @@ use_kknn <- function(formula, data, prefix = "kknn", verbose = FALSE, rec_cl <- initial_recipe_call(match.call()) rec_syntax <- - paste0(prefix, "_recipe") %>% + paste0(prefix, "_recipe") |> assign_value(!!rec_cl) rec <- recipes::recipe(formula, data) rec_syntax <- - rec_syntax %>% + rec_syntax |> factor_check(rec, add = verbose, colors = colors) if (has_factor_pred(rec)) { @@ -203,8 +203,8 @@ use_kknn <- function(formula, data, prefix = "kknn", verbose = FALSE, add_steps_dummy_vars(rec_syntax, add = verbose, colors = colors) } rec_syntax <- - rec_syntax %>% - add_comment(paste(dist_msg, zv_msg), add = verbose, colors = colors) %>% + rec_syntax |> + add_comment(paste(dist_msg, zv_msg), add = verbose, colors = colors) |> add_steps_normalization() if (tune) { @@ -214,9 +214,9 @@ use_kknn <- function(formula, data, prefix = "kknn", verbose = FALSE, } mod_syntax <- - paste0(prefix, "_spec") %>% - assign_value(!!rlang::call2("nearest_neighbor", !!!prm)) %>% - pipe_value(set_mode(!!model_mode(rec))) %>% + paste0(prefix, "_spec") |> + assign_value(!!rlang::call2("nearest_neighbor", !!!prm)) |> + pipe_value(set_mode(!!model_mode(rec))) |> pipe_value(set_engine("kknn")) route(rec_syntax, path = pth) @@ -242,13 +242,13 @@ use_ranger <- function(formula, data, prefix = "ranger", verbose = FALSE, rec_cl <- initial_recipe_call(match.call()) rec_syntax <- - paste0(prefix, "_recipe") %>% + paste0(prefix, "_recipe") |> assign_value(!!rec_cl) rec <- recipes::recipe(formula, data) rec_syntax <- - rec_syntax %>% + rec_syntax |> factor_check(rec, add = verbose, colors = colors) # TODO add a check for the factor levels that are an issue for @@ -260,9 +260,9 @@ use_ranger <- function(formula, data, prefix = "ranger", verbose = FALSE, } mod_syntax <- - paste0(prefix, "_spec") %>% - assign_value(!!rlang::call2("rand_forest", !!!prm)) %>% - pipe_value(set_mode(!!model_mode(rec))) %>% + paste0(prefix, "_spec") |> + assign_value(!!rlang::call2("rand_forest", !!!prm)) |> + pipe_value(set_mode(!!model_mode(rec))) |> pipe_value(set_engine("ranger")) route(rec_syntax, path = pth) @@ -288,13 +288,13 @@ use_earth <- function(formula, data, prefix = "earth", verbose = FALSE, rec_cl <- initial_recipe_call(match.call()) rec_syntax <- - paste0(prefix, "_recipe") %>% + paste0(prefix, "_recipe") |> assign_value(!!rec_cl) rec <- recipe(formula, data) rec_syntax <- - rec_syntax %>% + rec_syntax |> factor_check(rec, add = verbose, colors = colors) if (has_factor_pred(rec)) { @@ -314,9 +314,9 @@ use_earth <- function(formula, data, prefix = "earth", verbose = FALSE, } mod_syntax <- - paste0(prefix, "_spec") %>% - assign_value(!!rlang::call2("mars", !!!prm)) %>% - pipe_value(set_mode(!!model_mode(rec))) %>% + paste0(prefix, "_spec") |> + assign_value(!!rlang::call2("mars", !!!prm)) |> + pipe_value(set_mode(!!model_mode(rec))) |> pipe_value(set_engine("earth")) route(rec_syntax, path = pth) @@ -362,7 +362,7 @@ use_cubist <- function(formula, data, prefix = "cubist", verbose = FALSE, rec_cl <- initial_recipe_call(match.call()) rec_syntax <- - paste0(prefix, "_recipe") %>% + paste0(prefix, "_recipe") |> assign_value(!!rec_cl) rec <- recipes::recipe(formula, data) @@ -370,7 +370,7 @@ use_cubist <- function(formula, data, prefix = "cubist", verbose = FALSE, rlang::abort("Cubist models are only for regression") } rec_syntax <- - rec_syntax %>% + rec_syntax |> factor_check(rec, add = verbose, colors = colors) rec_syntax <- pipe_value(rec_syntax, step_zv(all_predictors())) @@ -382,8 +382,8 @@ use_cubist <- function(formula, data, prefix = "cubist", verbose = FALSE, } mod_syntax <- - paste0(prefix, "_spec") %>% - assign_value(!!rlang::call2("cubist_rules", !!!prm)) %>% + paste0(prefix, "_spec") |> + assign_value(!!rlang::call2("cubist_rules", !!!prm)) |> pipe_value(set_engine("Cubist")) route("library(rules)", path = pth, sep = "") @@ -414,14 +414,14 @@ use_kernlab_svm_rbf <- function(formula, data, prefix = "kernlab", verbose = FAL rec_cl <- initial_recipe_call(match.call()) rec_syntax <- - paste0(prefix, "_recipe") %>% + paste0(prefix, "_recipe") |> assign_value(!!rec_cl) rec <- recipes::recipe(formula, data) rec_syntax <- - rec_syntax %>% - add_comment(paste(dot_msg, zv_msg), add = verbose, colors = colors) %>% + rec_syntax |> + add_comment(paste(dot_msg, zv_msg), add = verbose, colors = colors) |> add_steps_normalization() mod_mode <- model_mode(rec) @@ -433,8 +433,8 @@ use_kernlab_svm_rbf <- function(formula, data, prefix = "kernlab", verbose = FAL } mod_syntax <- - paste0(prefix, "_spec") %>% - assign_value(!!rlang::call2("svm_rbf", !!!prm)) %>% + paste0(prefix, "_spec") |> + assign_value(!!rlang::call2("svm_rbf", !!!prm)) |> pipe_value(set_mode(!!model_mode(rec))) route(rec_syntax, path = pth) @@ -459,14 +459,14 @@ use_kernlab_svm_poly <- function(formula, data, prefix = "kernlab", verbose = FA rec_cl <- initial_recipe_call(match.call()) rec_syntax <- - paste0(prefix, "_recipe") %>% + paste0(prefix, "_recipe") |> assign_value(!!rec_cl) rec <- recipes::recipe(formula, data) rec_syntax <- - rec_syntax %>% - add_comment(paste(dot_msg, zv_msg), add = verbose, colors = colors) %>% + rec_syntax |> + add_comment(paste(dot_msg, zv_msg), add = verbose, colors = colors) |> add_steps_normalization() mod_mode <- model_mode(rec) @@ -478,8 +478,8 @@ use_kernlab_svm_poly <- function(formula, data, prefix = "kernlab", verbose = FA } mod_syntax <- - paste0(prefix, "_spec") %>% - assign_value(!!rlang::call2("svm_poly", !!!prm)) %>% + paste0(prefix, "_spec") |> + assign_value(!!rlang::call2("svm_poly", !!!prm)) |> pipe_value(set_mode(!!model_mode(rec))) route(rec_syntax, path = pth) @@ -504,7 +504,7 @@ use_C5.0 <- function(formula, data, prefix = "C50", verbose = FALSE, rec_cl <- initial_recipe_call(match.call()) rec_syntax <- - paste0(prefix, "_recipe") %>% + paste0(prefix, "_recipe") |> assign_value(!!rec_cl) rec <- recipes::recipe(formula, data) @@ -512,7 +512,7 @@ use_C5.0 <- function(formula, data, prefix = "C50", verbose = FALSE, rlang::abort("C5.0 models are only for classification.") } rec_syntax <- - rec_syntax %>% + rec_syntax |> factor_check(rec, add = verbose, colors = colors) if (tune) { @@ -522,9 +522,9 @@ use_C5.0 <- function(formula, data, prefix = "C50", verbose = FALSE, } mod_syntax <- - paste0(prefix, "_spec") %>% - assign_value(!!rlang::call2("boost_tree", !!!prm)) %>% - pipe_value(set_mode("classification")) %>% + paste0(prefix, "_spec") |> + assign_value(!!rlang::call2("boost_tree", !!!prm)) |> + pipe_value(set_mode("classification")) |> pipe_value(set_engine("C5.0")) route(rec_syntax, path = pth) @@ -548,7 +548,7 @@ use_nnet <- function(formula, data, prefix = "nnet", verbose = FALSE, rec_cl <- initial_recipe_call(match.call()) rec_syntax <- - paste0(prefix, "_recipe") %>% + paste0(prefix, "_recipe") |> assign_value(!!rec_cl) rec <- recipes::recipe(formula, data) @@ -559,8 +559,8 @@ use_nnet <- function(formula, data, prefix = "nnet", verbose = FALSE, } rec_syntax <- - rec_syntax %>% - factor_check(rec, add = verbose, colors = colors) %>% + rec_syntax |> + factor_check(rec, add = verbose, colors = colors) |> add_steps_normalization() if (tune) { @@ -570,8 +570,8 @@ use_nnet <- function(formula, data, prefix = "nnet", verbose = FALSE, } mod_syntax <- - paste0(prefix, "_spec") %>% - assign_value(!!rlang::call2("mlp", !!!prm)) %>% + paste0(prefix, "_spec") |> + assign_value(!!rlang::call2("mlp", !!!prm)) |> pipe_value(set_mode(!!model_mode(rec))) route(rec_syntax, path = pth) @@ -596,13 +596,13 @@ use_rpart <- function(formula, data, prefix = "rpart", verbose = FALSE, rec_cl <- initial_recipe_call(match.call()) rec_syntax <- - paste0(prefix, "_recipe") %>% + paste0(prefix, "_recipe") |> assign_value(!!rec_cl) rec <- recipe(formula, data) rec_syntax <- - rec_syntax %>% + rec_syntax |> factor_check(rec, add = verbose, colors = colors) if (tune) { @@ -615,9 +615,9 @@ use_rpart <- function(formula, data, prefix = "rpart", verbose = FALSE, } mod_syntax <- - paste0(prefix, "_spec") %>% - assign_value(!!rlang::call2("decision_tree", !!!prm)) %>% - pipe_value(set_mode(!!model_mode(rec))) %>% + paste0(prefix, "_spec") |> + assign_value(!!rlang::call2("decision_tree", !!!prm)) |> + pipe_value(set_mode(!!model_mode(rec))) |> pipe_value(set_engine("rpart")) route(rec_syntax, path = pth) @@ -641,13 +641,13 @@ use_bag_tree_rpart <- function(formula, data, prefix = "rpart", verbose = FALSE, rec_cl <- initial_recipe_call(match.call()) rec_syntax <- - paste0(prefix, "_recipe") %>% + paste0(prefix, "_recipe") |> assign_value(!!rec_cl) rec <- recipe(formula, data) rec_syntax <- - rec_syntax %>% + rec_syntax |> factor_check(rec, add = verbose, colors = colors) if (tune) { @@ -662,9 +662,9 @@ use_bag_tree_rpart <- function(formula, data, prefix = "rpart", verbose = FALSE, } mod_syntax <- - paste0(prefix, "_spec") %>% - assign_value(!!rlang::call2("bag_tree", !!!prm)) %>% - pipe_value(set_mode(!!model_mode(rec))) %>% + paste0(prefix, "_spec") |> + assign_value(!!rlang::call2("bag_tree", !!!prm)) |> + pipe_value(set_mode(!!model_mode(rec))) |> pipe_value(set_engine("rpart")) route("library(baguette)", path = pth, sep = "") @@ -689,13 +689,13 @@ use_mgcv <- function(formula, data, prefix = "mgcv", verbose = FALSE, rec_cl <- initial_recipe_call(match.call()) rec_syntax <- - paste0(prefix, "_recipe") %>% + paste0(prefix, "_recipe") |> assign_value(!!rec_cl) rec <- recipe(formula, data) rec_syntax <- - rec_syntax %>% + rec_syntax |> factor_check(rec, add = verbose, colors = colors) if (tune) { @@ -708,9 +708,9 @@ use_mgcv <- function(formula, data, prefix = "mgcv", verbose = FALSE, } mod_syntax <- - paste0(prefix, "_spec") %>% - assign_value(!!rlang::call2("gen_additive_mod", !!!prm)) %>% - pipe_value(set_mode(!!model_mode(rec))) %>% + paste0(prefix, "_spec") |> + assign_value(!!rlang::call2("gen_additive_mod", !!!prm)) |> + pipe_value(set_mode(!!model_mode(rec))) |> pipe_value(set_engine("mgcv")) spec_expr <- rlang::call2( @@ -719,9 +719,9 @@ use_mgcv <- function(formula, data, prefix = "mgcv", verbose = FALSE, formula = expr(stop("add your gam formula")) ) - wf_syntax <- paste0(prefix, "_workflow") %>% - assign_value(workflow()) %>% - pipe_value(add_recipe(!!rlang::sym(paste0(prefix, "_recipe")))) %>% + wf_syntax <- paste0(prefix, "_workflow") |> + assign_value(workflow()) |> + pipe_value(add_recipe(!!rlang::sym(paste0(prefix, "_recipe")))) |> pipe_value(!!spec_expr) route(rec_syntax, path = pth) @@ -747,13 +747,13 @@ use_dbarts <- function(formula, data, prefix = "dbarts", verbose = FALSE, rec_cl <- initial_recipe_call(match.call()) rec_syntax <- - paste0(prefix, "_recipe") %>% + paste0(prefix, "_recipe") |> assign_value(!!rec_cl) rec <- recipe(formula, data) rec_syntax <- - rec_syntax %>% + rec_syntax |> factor_check(rec, add = verbose, colors = colors) if (tune) { @@ -768,9 +768,9 @@ use_dbarts <- function(formula, data, prefix = "dbarts", verbose = FALSE, } mod_syntax <- - paste0(prefix, "_spec") %>% - assign_value(!!rlang::call2("bart", !!!prm)) %>% - pipe_value(set_mode(!!model_mode(rec))) %>% + paste0(prefix, "_spec") |> + assign_value(!!rlang::call2("bart", !!!prm)) |> + pipe_value(set_mode(!!model_mode(rec))) |> pipe_value(set_engine("dbarts")) route(rec_syntax, path = pth) @@ -794,13 +794,13 @@ use_mixOmics <- function(formula, data, prefix = "mixOmics", verbose = FALSE, rec_cl <- initial_recipe_call(match.call()) rec_syntax <- - paste0(prefix, "_recipe") %>% + paste0(prefix, "_recipe") |> assign_value(!!rec_cl) rec <- recipe(formula, data) rec_syntax <- - rec_syntax %>% + rec_syntax |> factor_check(rec, add = verbose, colors = colors) if (has_factor_pred(rec)) { @@ -809,7 +809,7 @@ use_mixOmics <- function(formula, data, prefix = "mixOmics", verbose = FALSE, } rec_syntax <- - rec_syntax %>% + rec_syntax |> add_steps_normalization() if (tune) { @@ -821,9 +821,9 @@ use_mixOmics <- function(formula, data, prefix = "mixOmics", verbose = FALSE, prm <- NULL } mod_syntax <- - paste0(prefix, "_spec") %>% - assign_value(!!rlang::call2("pls", !!!prm)) %>% - pipe_value(set_mode(!!model_mode(rec))) %>% + paste0(prefix, "_spec") |> + assign_value(!!rlang::call2("pls", !!!prm)) |> + pipe_value(set_mode(!!model_mode(rec))) |> pipe_value(set_engine("mixOmics")) route("library(plsmod)", path = pth, sep = "") @@ -848,13 +848,13 @@ use_xrf <- function(formula, data, prefix = "xrf", verbose = FALSE, rec_cl <- initial_recipe_call(match.call()) rec_syntax <- - paste0(prefix, "_recipe") %>% + paste0(prefix, "_recipe") |> assign_value(!!rec_cl) rec <- recipe(formula, data) rec_syntax <- - rec_syntax %>% + rec_syntax |> factor_check(rec, add = verbose, colors = colors) if (has_factor_pred(rec)) { @@ -863,7 +863,7 @@ use_xrf <- function(formula, data, prefix = "xrf", verbose = FALSE, } rec_syntax <- - rec_syntax %>% + rec_syntax |> add_steps_normalization() if (tune) { @@ -883,9 +883,9 @@ use_xrf <- function(formula, data, prefix = "xrf", verbose = FALSE, } mod_syntax <- - paste0(prefix, "_spec") %>% - assign_value(!!rlang::call2("rule_fit", !!!prm)) %>% - pipe_value(set_mode(!!model_mode(rec))) %>% + paste0(prefix, "_spec") |> + assign_value(!!rlang::call2("rule_fit", !!!prm)) |> + pipe_value(set_mode(!!model_mode(rec))) |> pipe_value(set_engine("xrf")) route("library(rules)", path = pth, sep = "") diff --git a/R/usemodels-package.R b/R/usemodels-package.R index 816683c..fd0a6c9 100644 --- a/R/usemodels-package.R +++ b/R/usemodels-package.R @@ -8,7 +8,6 @@ #' @importFrom dplyr one_of #' @importFrom dplyr pull #' @importFrom dplyr select -#' @importFrom recipes %>% #' @importFrom recipes all_predictors #' @importFrom recipes recipe ## usethis namespace: end diff --git a/README.md b/README.md index 4265b30..2fb974d 100644 --- a/README.md +++ b/README.md @@ -25,20 +25,20 @@ For example, using the palmerpenguins data with a `glmnet` model: > data(penguins) > use_glmnet(body_mass_g ~ ., data = penguins) glmnet_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% - step_dummy(all_nominal_predictors()) %>% - step_zv(all_predictors()) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> + step_dummy(all_nominal_predictors()) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) glmnet_spec <- - linear_reg(penalty = tune(), mixture = tune()) %>% - set_mode("regression") %>% + linear_reg(penalty = tune(), mixture = tune()) |> + set_mode("regression") |> set_engine("glmnet") glmnet_workflow <- - workflow() %>% - add_recipe(glmnet_recipe) %>% + workflow() |> + add_recipe(glmnet_recipe) |> add_model(glmnet_spec) glmnet_grid <- tidyr::crossing(penalty = 10^seq(-6, -1, length.out = 20), mixture = c(0.05, diff --git a/inst/WORDLIST b/inst/WORDLIST index e2b6675..57edf17 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -5,6 +5,7 @@ RStudio Tidymodels funder lifecycle +magrittr palmerpenguins reprex tidymodels diff --git a/tests/testthat/_snaps/clipboard.md b/tests/testthat/_snaps/clipboard.md index 24ca500..e447e29 100644 --- a/tests/testthat/_snaps/clipboard.md +++ b/tests/testthat/_snaps/clipboard.md @@ -11,3182 +11,12 @@ [4] " recipe(formula = body_mass_g ~ ., data = penguins) " [5] "" [6] "test_config_1_dummies_spec <- " - [7] " bag_tree() %>% " - [8] " set_mode(\"regression\") %>% " + [7] " bag_tree() |> " + [8] " set_mode(\"regression\") |> " [9] " set_engine(\"rpart\") " [10] "" [11] "test_config_1_dummies_workflow <- " - [12] " workflow() %>% " - [13] " add_recipe(test_config_1_dummies_recipe) %>% " + [12] " workflow() |> " + [13] " add_recipe(test_config_1_dummies_recipe) |> " [14] " add_model(test_config_1_dummies_spec) " ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "library(baguette)" - [2] "" - [3] "test_config_1_no_dummies_recipe <- " - [4] " recipe(formula = species ~ ., data = penguins) " - [5] "" - [6] "test_config_1_no_dummies_spec <- " - [7] " bag_tree() %>% " - [8] " set_mode(\"classification\") %>% " - [9] " set_engine(\"rpart\") " - [10] "" - [11] "test_config_1_no_dummies_workflow <- " - [12] " workflow() %>% " - [13] " add_recipe(test_config_1_no_dummies_recipe) %>% " - [14] " add_model(test_config_1_no_dummies_spec) " - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_2_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) " - [3] "" - [4] "test_config_2_no_dummies_spec <- " - [5] " boost_tree() %>% " - [6] " set_mode(\"classification\") %>% " - [7] " set_engine(\"C5.0\") " - [8] "" - [9] "test_config_2_no_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_2_no_dummies_recipe) %>% " - [12] " add_model(test_config_2_no_dummies_spec) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "library(rules)" - [2] "" - [3] "test_config_3_dummies_recipe <- " - [4] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [5] " step_zv(all_predictors()) " - [6] "" - [7] "test_config_3_dummies_spec <- " - [8] " cubist_rules() %>% " - [9] " set_engine(\"Cubist\") " - [10] "" - [11] "test_config_3_dummies_workflow <- " - [12] " workflow() %>% " - [13] " add_recipe(test_config_3_dummies_recipe) %>% " - [14] " add_model(test_config_3_dummies_spec) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_4_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) " - [3] "" - [4] "test_config_4_dummies_spec <- " - [5] " bart() %>% " - [6] " set_mode(\"regression\") %>% " - [7] " set_engine(\"dbarts\") " - [8] "" - [9] "test_config_4_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_4_dummies_recipe) %>% " - [12] " add_model(test_config_4_dummies_spec) " - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_4_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) " - [3] "" - [4] "test_config_4_no_dummies_spec <- " - [5] " bart() %>% " - [6] " set_mode(\"classification\") %>% " - [7] " set_engine(\"dbarts\") " - [8] "" - [9] "test_config_4_no_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_4_no_dummies_recipe) %>% " - [12] " add_model(test_config_4_no_dummies_spec) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_5_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " ## This model requires the predictors to be numeric. The most common " - [5] " ## method to convert qualitative predictors to numeric is to create " - [6] " ## binary indicator variables (aka dummy variables) from these " - [7] " ## predictors. " - [8] " step_dummy(all_nominal_predictors()) %>% " - [9] " step_zv(all_predictors()) " - [10] "" - [11] "test_config_5_dummies_spec <- " - [12] " mars() %>% " - [13] " set_mode(\"regression\") %>% " - [14] " set_engine(\"earth\") " - [15] "" - [16] "test_config_5_dummies_workflow <- " - [17] " workflow() %>% " - [18] " add_recipe(test_config_5_dummies_recipe) %>% " - [19] " add_model(test_config_5_dummies_spec) " - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_5_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " ## This model requires the predictors to be numeric. The most common " - [5] " ## method to convert qualitative predictors to numeric is to create " - [6] " ## binary indicator variables (aka dummy variables) from these " - [7] " ## predictors. " - [8] " step_dummy(all_nominal_predictors()) %>% " - [9] " step_zv(all_predictors()) " - [10] "" - [11] "test_config_5_no_dummies_spec <- " - [12] " mars() %>% " - [13] " set_mode(\"classification\") %>% " - [14] " set_engine(\"earth\") " - [15] "" - [16] "test_config_5_no_dummies_workflow <- " - [17] " workflow() %>% " - [18] " add_recipe(test_config_5_no_dummies_recipe) %>% " - [19] " add_model(test_config_5_no_dummies_spec) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_6_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " ## This model requires the predictors to be numeric. The most common " - [5] " ## method to convert qualitative predictors to numeric is to create " - [6] " ## binary indicator variables (aka dummy variables) from these " - [7] " ## predictors. " - [8] " step_dummy(all_nominal_predictors()) %>% " - [9] " ## Regularization methods sum up functions of the model slope " - [10] " ## coefficients. Because of this, the predictor variables should be on " - [11] " ## the same scale. Before centering and scaling the numeric predictors, " - [12] " ## any predictors with a single unique value are filtered out. " - [13] " step_zv(all_predictors()) %>% " - [14] " step_normalize(all_numeric_predictors()) " - [15] "" - [16] "test_config_6_dummies_spec <- " - [17] " linear_reg() %>% " - [18] " set_mode(\"regression\") %>% " - [19] " set_engine(\"glmnet\") " - [20] "" - [21] "test_config_6_dummies_workflow <- " - [22] " workflow() %>% " - [23] " add_recipe(test_config_6_dummies_recipe) %>% " - [24] " add_model(test_config_6_dummies_spec) " - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_6_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " ## This model requires the predictors to be numeric. The most common " - [5] " ## method to convert qualitative predictors to numeric is to create " - [6] " ## binary indicator variables (aka dummy variables) from these " - [7] " ## predictors. " - [8] " step_dummy(all_nominal_predictors()) %>% " - [9] " ## Regularization methods sum up functions of the model slope " - [10] " ## coefficients. Because of this, the predictor variables should be on " - [11] " ## the same scale. Before centering and scaling the numeric predictors, " - [12] " ## any predictors with a single unique value are filtered out. " - [13] " step_zv(all_predictors()) %>% " - [14] " step_normalize(all_numeric_predictors()) " - [15] "" - [16] "test_config_6_no_dummies_spec <- " - [17] " multinom_reg() %>% " - [18] " set_mode(\"classification\") %>% " - [19] " set_engine(\"glmnet\") " - [20] "" - [21] "test_config_6_no_dummies_workflow <- " - [22] " workflow() %>% " - [23] " add_recipe(test_config_6_no_dummies_recipe) %>% " - [24] " add_model(test_config_6_no_dummies_spec) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_7_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [3] " ## Since dot product calculations are used, the predictor variables " - [4] " ## should be on the same scale. Before centering and scaling the numeric " - [5] " ## predictors, any predictors with a single unique value are filtered " - [6] " ## out. " - [7] " step_zv(all_predictors()) %>% " - [8] " step_normalize(all_numeric_predictors()) " - [9] "" - [10] "test_config_7_dummies_spec <- " - [11] " svm_poly() %>% " - [12] " set_mode(\"regression\") " - [13] "" - [14] "test_config_7_dummies_workflow <- " - [15] " workflow() %>% " - [16] " add_recipe(test_config_7_dummies_recipe) %>% " - [17] " add_model(test_config_7_dummies_spec) " - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_7_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) %>% " - [3] " ## Since dot product calculations are used, the predictor variables " - [4] " ## should be on the same scale. Before centering and scaling the numeric " - [5] " ## predictors, any predictors with a single unique value are filtered " - [6] " ## out. " - [7] " step_zv(all_predictors()) %>% " - [8] " step_normalize(all_numeric_predictors()) " - [9] "" - [10] "test_config_7_no_dummies_spec <- " - [11] " svm_poly() %>% " - [12] " set_mode(\"classification\") " - [13] "" - [14] "test_config_7_no_dummies_workflow <- " - [15] " workflow() %>% " - [16] " add_recipe(test_config_7_no_dummies_recipe) %>% " - [17] " add_model(test_config_7_no_dummies_spec) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_8_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [3] " ## Since dot product calculations are used, the predictor variables " - [4] " ## should be on the same scale. Before centering and scaling the numeric " - [5] " ## predictors, any predictors with a single unique value are filtered " - [6] " ## out. " - [7] " step_zv(all_predictors()) %>% " - [8] " step_normalize(all_numeric_predictors()) " - [9] "" - [10] "test_config_8_dummies_spec <- " - [11] " svm_rbf() %>% " - [12] " set_mode(\"regression\") " - [13] "" - [14] "test_config_8_dummies_workflow <- " - [15] " workflow() %>% " - [16] " add_recipe(test_config_8_dummies_recipe) %>% " - [17] " add_model(test_config_8_dummies_spec) " - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_8_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) %>% " - [3] " ## Since dot product calculations are used, the predictor variables " - [4] " ## should be on the same scale. Before centering and scaling the numeric " - [5] " ## predictors, any predictors with a single unique value are filtered " - [6] " ## out. " - [7] " step_zv(all_predictors()) %>% " - [8] " step_normalize(all_numeric_predictors()) " - [9] "" - [10] "test_config_8_no_dummies_spec <- " - [11] " svm_rbf() %>% " - [12] " set_mode(\"classification\") " - [13] "" - [14] "test_config_8_no_dummies_workflow <- " - [15] " workflow() %>% " - [16] " add_recipe(test_config_8_no_dummies_recipe) %>% " - [17] " add_model(test_config_8_no_dummies_spec) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_9_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " ## This model requires the predictors to be numeric. The most common " - [5] " ## method to convert qualitative predictors to numeric is to create " - [6] " ## binary indicator variables (aka dummy variables) from these " - [7] " ## predictors. " - [8] " step_dummy(all_nominal_predictors()) %>% " - [9] " ## Since distance calculations are used, the predictor variables should " - [10] " ## be on the same scale. Before centering and scaling the numeric " - [11] " ## predictors, any predictors with a single unique value are filtered " - [12] " ## out. " - [13] " step_zv(all_predictors()) %>% " - [14] " step_normalize(all_numeric_predictors()) " - [15] "" - [16] "test_config_9_dummies_spec <- " - [17] " nearest_neighbor() %>% " - [18] " set_mode(\"regression\") %>% " - [19] " set_engine(\"kknn\") " - [20] "" - [21] "test_config_9_dummies_workflow <- " - [22] " workflow() %>% " - [23] " add_recipe(test_config_9_dummies_recipe) %>% " - [24] " add_model(test_config_9_dummies_spec) " - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_9_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " ## This model requires the predictors to be numeric. The most common " - [5] " ## method to convert qualitative predictors to numeric is to create " - [6] " ## binary indicator variables (aka dummy variables) from these " - [7] " ## predictors. " - [8] " step_dummy(all_nominal_predictors()) %>% " - [9] " ## Since distance calculations are used, the predictor variables should " - [10] " ## be on the same scale. Before centering and scaling the numeric " - [11] " ## predictors, any predictors with a single unique value are filtered " - [12] " ## out. " - [13] " step_zv(all_predictors()) %>% " - [14] " step_normalize(all_numeric_predictors()) " - [15] "" - [16] "test_config_9_no_dummies_spec <- " - [17] " nearest_neighbor() %>% " - [18] " set_mode(\"classification\") %>% " - [19] " set_engine(\"kknn\") " - [20] "" - [21] "test_config_9_no_dummies_workflow <- " - [22] " workflow() %>% " - [23] " add_recipe(test_config_9_no_dummies_recipe) %>% " - [24] " add_model(test_config_9_no_dummies_spec) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_10_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) " - [3] "" - [4] "test_config_10_dummies_spec <- " - [5] " gen_additive_mod() %>% " - [6] " set_mode(\"regression\") %>% " - [7] " set_engine(\"mgcv\") " - [8] "" - [9] "test_config_10_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_10_dummies_recipe) %>% " - [12] " add_model(test_config_10_dummies_spec, formula = stop(\"add your gam formula\")) " - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_10_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) " - [3] "" - [4] "test_config_10_no_dummies_spec <- " - [5] " gen_additive_mod() %>% " - [6] " set_mode(\"classification\") %>% " - [7] " set_engine(\"mgcv\") " - [8] "" - [9] "test_config_10_no_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_10_no_dummies_recipe) %>% " - [12] " add_model(test_config_10_no_dummies_spec, formula = stop(\"add your gam formula\")) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "library(plsmod)" - [2] "" - [3] "test_config_11_dummies_recipe <- " - [4] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [5] " step_novel(all_nominal_predictors()) %>% " - [6] " ## This model requires the predictors to be numeric. The most common " - [7] " ## method to convert qualitative predictors to numeric is to create " - [8] " ## binary indicator variables (aka dummy variables) from these " - [9] " ## predictors. " - [10] " step_dummy(all_nominal_predictors()) %>% " - [11] " step_zv(all_predictors()) %>% " - [12] " step_normalize(all_numeric_predictors()) " - [13] "" - [14] "test_config_11_dummies_spec <- " - [15] " pls() %>% " - [16] " set_mode(\"regression\") %>% " - [17] " set_engine(\"mixOmics\") " - [18] "" - [19] "test_config_11_dummies_workflow <- " - [20] " workflow() %>% " - [21] " add_recipe(test_config_11_dummies_recipe) %>% " - [22] " add_model(test_config_11_dummies_spec) " - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "library(plsmod)" - [2] "" - [3] "test_config_11_no_dummies_recipe <- " - [4] " recipe(formula = species ~ ., data = penguins) %>% " - [5] " step_novel(all_nominal_predictors()) %>% " - [6] " ## This model requires the predictors to be numeric. The most common " - [7] " ## method to convert qualitative predictors to numeric is to create " - [8] " ## binary indicator variables (aka dummy variables) from these " - [9] " ## predictors. " - [10] " step_dummy(all_nominal_predictors()) %>% " - [11] " step_zv(all_predictors()) %>% " - [12] " step_normalize(all_numeric_predictors()) " - [13] "" - [14] "test_config_11_no_dummies_spec <- " - [15] " pls() %>% " - [16] " set_mode(\"classification\") %>% " - [17] " set_engine(\"mixOmics\") " - [18] "" - [19] "test_config_11_no_dummies_workflow <- " - [20] " workflow() %>% " - [21] " add_recipe(test_config_11_no_dummies_recipe) %>% " - [22] " add_model(test_config_11_no_dummies_spec) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_12_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " ## This model requires the predictors to be numeric. The most common " - [5] " ## method to convert qualitative predictors to numeric is to create " - [6] " ## binary indicator variables (aka dummy variables) from these " - [7] " ## predictors. " - [8] " step_dummy(all_nominal_predictors()) %>% " - [9] " step_zv(all_predictors()) %>% " - [10] " step_normalize(all_numeric_predictors()) " - [11] "" - [12] "test_config_12_dummies_spec <- " - [13] " mlp() %>% " - [14] " set_mode(\"regression\") " - [15] "" - [16] "test_config_12_dummies_workflow <- " - [17] " workflow() %>% " - [18] " add_recipe(test_config_12_dummies_recipe) %>% " - [19] " add_model(test_config_12_dummies_spec) " - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_12_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " ## This model requires the predictors to be numeric. The most common " - [5] " ## method to convert qualitative predictors to numeric is to create " - [6] " ## binary indicator variables (aka dummy variables) from these " - [7] " ## predictors. " - [8] " step_dummy(all_nominal_predictors()) %>% " - [9] " step_zv(all_predictors()) %>% " - [10] " step_normalize(all_numeric_predictors()) " - [11] "" - [12] "test_config_12_no_dummies_spec <- " - [13] " mlp() %>% " - [14] " set_mode(\"classification\") " - [15] "" - [16] "test_config_12_no_dummies_workflow <- " - [17] " workflow() %>% " - [18] " add_recipe(test_config_12_no_dummies_recipe) %>% " - [19] " add_model(test_config_12_no_dummies_spec) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_13_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) " - [3] "" - [4] "test_config_13_dummies_spec <- " - [5] " rand_forest(trees = 1000) %>% " - [6] " set_mode(\"regression\") %>% " - [7] " set_engine(\"ranger\") " - [8] "" - [9] "test_config_13_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_13_dummies_recipe) %>% " - [12] " add_model(test_config_13_dummies_spec) " - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_13_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) " - [3] "" - [4] "test_config_13_no_dummies_spec <- " - [5] " rand_forest(trees = 1000) %>% " - [6] " set_mode(\"classification\") %>% " - [7] " set_engine(\"ranger\") " - [8] "" - [9] "test_config_13_no_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_13_no_dummies_recipe) %>% " - [12] " add_model(test_config_13_no_dummies_spec) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_14_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) " - [3] "" - [4] "test_config_14_dummies_spec <- " - [5] " decision_tree() %>% " - [6] " set_mode(\"regression\") %>% " - [7] " set_engine(\"rpart\") " - [8] "" - [9] "test_config_14_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_14_dummies_recipe) %>% " - [12] " add_model(test_config_14_dummies_spec) " - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_14_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) " - [3] "" - [4] "test_config_14_no_dummies_spec <- " - [5] " decision_tree() %>% " - [6] " set_mode(\"classification\") %>% " - [7] " set_engine(\"rpart\") " - [8] "" - [9] "test_config_14_no_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_14_no_dummies_recipe) %>% " - [12] " add_model(test_config_14_no_dummies_spec) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_15_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " ## This model requires the predictors to be numeric. The most common " - [5] " ## method to convert qualitative predictors to numeric is to create " - [6] " ## binary indicator variables (aka dummy variables) from these " - [7] " ## predictors. However, for this model, binary indicator variables can be " - [8] " ## made for each of the levels of the factors (known as 'one-hot " - [9] " ## encoding'). " - [10] " step_dummy(all_nominal_predictors(), one_hot = TRUE) %>% " - [11] " step_zv(all_predictors()) " - [12] "" - [13] "test_config_15_dummies_spec <- " - [14] " boost_tree() %>% " - [15] " set_mode(\"regression\") %>% " - [16] " set_engine(\"xgboost\") " - [17] "" - [18] "test_config_15_dummies_workflow <- " - [19] " workflow() %>% " - [20] " add_recipe(test_config_15_dummies_recipe) %>% " - [21] " add_model(test_config_15_dummies_spec) " - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_15_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " ## This model requires the predictors to be numeric. The most common " - [5] " ## method to convert qualitative predictors to numeric is to create " - [6] " ## binary indicator variables (aka dummy variables) from these " - [7] " ## predictors. However, for this model, binary indicator variables can be " - [8] " ## made for each of the levels of the factors (known as 'one-hot " - [9] " ## encoding'). " - [10] " step_dummy(all_nominal_predictors(), one_hot = TRUE) %>% " - [11] " step_zv(all_predictors()) " - [12] "" - [13] "test_config_15_no_dummies_spec <- " - [14] " boost_tree() %>% " - [15] " set_mode(\"classification\") %>% " - [16] " set_engine(\"xgboost\") " - [17] "" - [18] "test_config_15_no_dummies_workflow <- " - [19] " workflow() %>% " - [20] " add_recipe(test_config_15_no_dummies_recipe) %>% " - [21] " add_model(test_config_15_no_dummies_spec) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "library(rules)" - [2] "" - [3] "test_config_16_dummies_recipe <- " - [4] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [5] " step_novel(all_nominal_predictors()) %>% " - [6] " ## This model requires the predictors to be numeric. The most common " - [7] " ## method to convert qualitative predictors to numeric is to create " - [8] " ## binary indicator variables (aka dummy variables) from these " - [9] " ## predictors. " - [10] " step_dummy(all_nominal_predictors()) %>% " - [11] " step_zv(all_predictors()) %>% " - [12] " step_normalize(all_numeric_predictors()) " - [13] "" - [14] "test_config_16_dummies_spec <- " - [15] " rule_fit() %>% " - [16] " set_mode(\"regression\") %>% " - [17] " set_engine(\"xrf\") " - [18] "" - [19] "test_config_16_dummies_workflow <- " - [20] " workflow() %>% " - [21] " add_recipe(test_config_16_dummies_recipe) %>% " - [22] " add_model(test_config_16_dummies_spec) " - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "library(rules)" - [2] "" - [3] "test_config_16_no_dummies_recipe <- " - [4] " recipe(formula = species ~ ., data = penguins) %>% " - [5] " step_novel(all_nominal_predictors()) %>% " - [6] " ## This model requires the predictors to be numeric. The most common " - [7] " ## method to convert qualitative predictors to numeric is to create " - [8] " ## binary indicator variables (aka dummy variables) from these " - [9] " ## predictors. " - [10] " step_dummy(all_nominal_predictors()) %>% " - [11] " step_zv(all_predictors()) %>% " - [12] " step_normalize(all_numeric_predictors()) " - [13] "" - [14] "test_config_16_no_dummies_spec <- " - [15] " rule_fit() %>% " - [16] " set_mode(\"classification\") %>% " - [17] " set_engine(\"xrf\") " - [18] "" - [19] "test_config_16_no_dummies_workflow <- " - [20] " workflow() %>% " - [21] " add_recipe(test_config_16_no_dummies_recipe) %>% " - [22] " add_model(test_config_16_no_dummies_spec) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "library(baguette)" - [2] "" - [3] "test_config_17_dummies_recipe <- " - [4] " recipe(formula = body_mass_g ~ ., data = penguins) " - [5] "" - [6] "test_config_17_dummies_spec <- " - [7] " bag_tree(tree_depth = tune(), min_n = tune(), cost_complexity = tune()) %>% " - [8] " set_mode(\"regression\") %>% " - [9] " set_engine(\"rpart\") " - [10] "" - [11] "test_config_17_dummies_workflow <- " - [12] " workflow() %>% " - [13] " add_recipe(test_config_17_dummies_recipe) %>% " - [14] " add_model(test_config_17_dummies_spec) " - [15] "" - [16] "set.seed(27246)" - [17] "test_config_17_dummies_tune <-" - [18] " tune_grid(test_config_17_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [19] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "library(baguette)" - [2] "" - [3] "test_config_17_no_dummies_recipe <- " - [4] " recipe(formula = species ~ ., data = penguins) " - [5] "" - [6] "test_config_17_no_dummies_spec <- " - [7] " bag_tree(tree_depth = tune(), min_n = tune(), cost_complexity = tune()) %>% " - [8] " set_mode(\"classification\") %>% " - [9] " set_engine(\"rpart\") " - [10] "" - [11] "test_config_17_no_dummies_workflow <- " - [12] " workflow() %>% " - [13] " add_recipe(test_config_17_no_dummies_recipe) %>% " - [14] " add_model(test_config_17_no_dummies_spec) " - [15] "" - [16] "set.seed(27246)" - [17] "test_config_17_no_dummies_tune <-" - [18] " tune_grid(test_config_17_no_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [19] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_18_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) " - [3] "" - [4] "test_config_18_no_dummies_spec <- " - [5] " boost_tree(trees = tune(), min_n = tune()) %>% " - [6] " set_mode(\"classification\") %>% " - [7] " set_engine(\"C5.0\") " - [8] "" - [9] "test_config_18_no_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_18_no_dummies_recipe) %>% " - [12] " add_model(test_config_18_no_dummies_spec) " - [13] "" - [14] "set.seed(27246)" - [15] "test_config_18_no_dummies_tune <-" - [16] " tune_grid(test_config_18_no_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [17] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "library(rules)" - [2] "" - [3] "test_config_19_dummies_recipe <- " - [4] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [5] " step_zv(all_predictors()) " - [6] "" - [7] "test_config_19_dummies_spec <- " - [8] " cubist_rules(committees = tune(), neighbors = tune()) %>% " - [9] " set_engine(\"Cubist\") " - [10] "" - [11] "test_config_19_dummies_workflow <- " - [12] " workflow() %>% " - [13] " add_recipe(test_config_19_dummies_recipe) %>% " - [14] " add_model(test_config_19_dummies_spec) " - [15] "" - [16] "test_config_19_dummies_grid <- tidyr::crossing(committees = c(1:9, (1:5) * " - [17] " 10), neighbors = c(0, 3, 6, 9)) " - [18] "" - [19] "test_config_19_dummies_tune <- " - [20] " tune_grid(test_config_19_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [21] " grid = test_config_19_dummies_grid) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_20_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) " - [3] "" - [4] "test_config_20_dummies_spec <- " - [5] " bart(trees = tune(), prior_terminal_node_coef = tune(), prior_terminal_node_expo = tune()) %>% " - [6] " set_mode(\"regression\") %>% " - [7] " set_engine(\"dbarts\") " - [8] "" - [9] "test_config_20_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_20_dummies_recipe) %>% " - [12] " add_model(test_config_20_dummies_spec) " - [13] "" - [14] "set.seed(27246)" - [15] "test_config_20_dummies_tune <-" - [16] " tune_grid(test_config_20_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [17] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_20_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) " - [3] "" - [4] "test_config_20_no_dummies_spec <- " - [5] " bart(trees = tune(), prior_terminal_node_coef = tune(), prior_terminal_node_expo = tune()) %>% " - [6] " set_mode(\"classification\") %>% " - [7] " set_engine(\"dbarts\") " - [8] "" - [9] "test_config_20_no_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_20_no_dummies_recipe) %>% " - [12] " add_model(test_config_20_no_dummies_spec) " - [13] "" - [14] "set.seed(27246)" - [15] "test_config_20_no_dummies_tune <-" - [16] " tune_grid(test_config_20_no_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [17] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Output - ## MARS models can make predictions on many _sub_models_, meaning that we - ## can evaluate many values of `num_terms` without much computational - ## cost. A regular grid is used to exploit this property. The first term - ## is only the intercept, so the grid is a sequence of even numbered - ## values. - Message - v code is on the clipboard. - Output - [1] "test_config_21_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " ## This model requires the predictors to be numeric. The most common " - [5] " ## method to convert qualitative predictors to numeric is to create " - [6] " ## binary indicator variables (aka dummy variables) from these " - [7] " ## predictors. " - [8] " step_dummy(all_nominal_predictors()) %>% " - [9] " step_zv(all_predictors()) " - [10] "" - [11] "test_config_21_dummies_spec <- " - [12] " mars(num_terms = tune(), prod_degree = tune(), prune_method = \"none\") %>% " - [13] " set_mode(\"regression\") %>% " - [14] " set_engine(\"earth\") " - [15] "" - [16] "test_config_21_dummies_workflow <- " - [17] " workflow() %>% " - [18] " add_recipe(test_config_21_dummies_recipe) %>% " - [19] " add_model(test_config_21_dummies_spec) " - [20] "" - [21] "test_config_21_dummies_grid <- tidyr::crossing(num_terms = 2 * (1:6), prod_degree = 1:2) " - [22] "" - [23] "test_config_21_dummies_tune <- " - [24] " tune_grid(test_config_21_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [25] " grid = test_config_21_dummies_grid) " - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Output - ## MARS models can make predictions on many _sub_models_, meaning that we - ## can evaluate many values of `num_terms` without much computational - ## cost. A regular grid is used to exploit this property. The first term - ## is only the intercept, so the grid is a sequence of even numbered - ## values. - Message - v code is on the clipboard. - Output - [1] "test_config_21_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " ## This model requires the predictors to be numeric. The most common " - [5] " ## method to convert qualitative predictors to numeric is to create " - [6] " ## binary indicator variables (aka dummy variables) from these " - [7] " ## predictors. " - [8] " step_dummy(all_nominal_predictors()) %>% " - [9] " step_zv(all_predictors()) " - [10] "" - [11] "test_config_21_no_dummies_spec <- " - [12] " mars(num_terms = tune(), prod_degree = tune(), prune_method = \"none\") %>% " - [13] " set_mode(\"classification\") %>% " - [14] " set_engine(\"earth\") " - [15] "" - [16] "test_config_21_no_dummies_workflow <- " - [17] " workflow() %>% " - [18] " add_recipe(test_config_21_no_dummies_recipe) %>% " - [19] " add_model(test_config_21_no_dummies_spec) " - [20] "" - [21] "test_config_21_no_dummies_grid <- tidyr::crossing(num_terms = 2 * (1:6), prod_degree = 1:2) " - [22] "" - [23] "test_config_21_no_dummies_tune <- " - [24] " tune_grid(test_config_21_no_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [25] " grid = test_config_21_no_dummies_grid) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_22_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " ## This model requires the predictors to be numeric. The most common " - [5] " ## method to convert qualitative predictors to numeric is to create " - [6] " ## binary indicator variables (aka dummy variables) from these " - [7] " ## predictors. " - [8] " step_dummy(all_nominal_predictors()) %>% " - [9] " ## Regularization methods sum up functions of the model slope " - [10] " ## coefficients. Because of this, the predictor variables should be on " - [11] " ## the same scale. Before centering and scaling the numeric predictors, " - [12] " ## any predictors with a single unique value are filtered out. " - [13] " step_zv(all_predictors()) %>% " - [14] " step_normalize(all_numeric_predictors()) " - [15] "" - [16] "test_config_22_dummies_spec <- " - [17] " linear_reg(penalty = tune(), mixture = tune()) %>% " - [18] " set_mode(\"regression\") %>% " - [19] " set_engine(\"glmnet\") " - [20] "" - [21] "test_config_22_dummies_workflow <- " - [22] " workflow() %>% " - [23] " add_recipe(test_config_22_dummies_recipe) %>% " - [24] " add_model(test_config_22_dummies_spec) " - [25] "" - [26] "test_config_22_dummies_grid <- tidyr::crossing(penalty = 10^seq(-6, -1, length.out = 20), " - [27] " mixture = c(0.05, 0.2, 0.4, 0.6, 0.8, 1)) " - [28] "" - [29] "test_config_22_dummies_tune <- " - [30] " tune_grid(test_config_22_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [31] " grid = test_config_22_dummies_grid) " - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_22_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " ## This model requires the predictors to be numeric. The most common " - [5] " ## method to convert qualitative predictors to numeric is to create " - [6] " ## binary indicator variables (aka dummy variables) from these " - [7] " ## predictors. " - [8] " step_dummy(all_nominal_predictors()) %>% " - [9] " ## Regularization methods sum up functions of the model slope " - [10] " ## coefficients. Because of this, the predictor variables should be on " - [11] " ## the same scale. Before centering and scaling the numeric predictors, " - [12] " ## any predictors with a single unique value are filtered out. " - [13] " step_zv(all_predictors()) %>% " - [14] " step_normalize(all_numeric_predictors()) " - [15] "" - [16] "test_config_22_no_dummies_spec <- " - [17] " multinom_reg(penalty = tune(), mixture = tune()) %>% " - [18] " set_mode(\"classification\") %>% " - [19] " set_engine(\"glmnet\") " - [20] "" - [21] "test_config_22_no_dummies_workflow <- " - [22] " workflow() %>% " - [23] " add_recipe(test_config_22_no_dummies_recipe) %>% " - [24] " add_model(test_config_22_no_dummies_spec) " - [25] "" - [26] "test_config_22_no_dummies_grid <- tidyr::crossing(penalty = 10^seq(-6, -1, " - [27] " length.out = 20), mixture = c(0.05, 0.2, 0.4, 0.6, 0.8, 1)) " - [28] "" - [29] "test_config_22_no_dummies_tune <- " - [30] " tune_grid(test_config_22_no_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [31] " grid = test_config_22_no_dummies_grid) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_23_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [3] " ## Since dot product calculations are used, the predictor variables " - [4] " ## should be on the same scale. Before centering and scaling the numeric " - [5] " ## predictors, any predictors with a single unique value are filtered " - [6] " ## out. " - [7] " step_zv(all_predictors()) %>% " - [8] " step_normalize(all_numeric_predictors()) " - [9] "" - [10] "test_config_23_dummies_spec <- " - [11] " svm_poly(cost = tune(), degree = tune(), scale_factor = tune()) %>% " - [12] " set_mode(\"regression\") " - [13] "" - [14] "test_config_23_dummies_workflow <- " - [15] " workflow() %>% " - [16] " add_recipe(test_config_23_dummies_recipe) %>% " - [17] " add_model(test_config_23_dummies_spec) " - [18] "" - [19] "set.seed(27246)" - [20] "test_config_23_dummies_tune <-" - [21] " tune_grid(test_config_23_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [22] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_23_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) %>% " - [3] " ## Since dot product calculations are used, the predictor variables " - [4] " ## should be on the same scale. Before centering and scaling the numeric " - [5] " ## predictors, any predictors with a single unique value are filtered " - [6] " ## out. " - [7] " step_zv(all_predictors()) %>% " - [8] " step_normalize(all_numeric_predictors()) " - [9] "" - [10] "test_config_23_no_dummies_spec <- " - [11] " svm_poly(cost = tune(), degree = tune(), scale_factor = tune()) %>% " - [12] " set_mode(\"classification\") " - [13] "" - [14] "test_config_23_no_dummies_workflow <- " - [15] " workflow() %>% " - [16] " add_recipe(test_config_23_no_dummies_recipe) %>% " - [17] " add_model(test_config_23_no_dummies_spec) " - [18] "" - [19] "set.seed(27246)" - [20] "test_config_23_no_dummies_tune <-" - [21] " tune_grid(test_config_23_no_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [22] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_24_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [3] " ## Since dot product calculations are used, the predictor variables " - [4] " ## should be on the same scale. Before centering and scaling the numeric " - [5] " ## predictors, any predictors with a single unique value are filtered " - [6] " ## out. " - [7] " step_zv(all_predictors()) %>% " - [8] " step_normalize(all_numeric_predictors()) " - [9] "" - [10] "test_config_24_dummies_spec <- " - [11] " svm_rbf(cost = tune(), rbf_sigma = tune()) %>% " - [12] " set_mode(\"regression\") " - [13] "" - [14] "test_config_24_dummies_workflow <- " - [15] " workflow() %>% " - [16] " add_recipe(test_config_24_dummies_recipe) %>% " - [17] " add_model(test_config_24_dummies_spec) " - [18] "" - [19] "set.seed(27246)" - [20] "test_config_24_dummies_tune <-" - [21] " tune_grid(test_config_24_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [22] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_24_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) %>% " - [3] " ## Since dot product calculations are used, the predictor variables " - [4] " ## should be on the same scale. Before centering and scaling the numeric " - [5] " ## predictors, any predictors with a single unique value are filtered " - [6] " ## out. " - [7] " step_zv(all_predictors()) %>% " - [8] " step_normalize(all_numeric_predictors()) " - [9] "" - [10] "test_config_24_no_dummies_spec <- " - [11] " svm_rbf(cost = tune(), rbf_sigma = tune()) %>% " - [12] " set_mode(\"classification\") " - [13] "" - [14] "test_config_24_no_dummies_workflow <- " - [15] " workflow() %>% " - [16] " add_recipe(test_config_24_no_dummies_recipe) %>% " - [17] " add_model(test_config_24_no_dummies_spec) " - [18] "" - [19] "set.seed(27246)" - [20] "test_config_24_no_dummies_tune <-" - [21] " tune_grid(test_config_24_no_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [22] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_25_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " ## This model requires the predictors to be numeric. The most common " - [5] " ## method to convert qualitative predictors to numeric is to create " - [6] " ## binary indicator variables (aka dummy variables) from these " - [7] " ## predictors. " - [8] " step_dummy(all_nominal_predictors()) %>% " - [9] " ## Since distance calculations are used, the predictor variables should " - [10] " ## be on the same scale. Before centering and scaling the numeric " - [11] " ## predictors, any predictors with a single unique value are filtered " - [12] " ## out. " - [13] " step_zv(all_predictors()) %>% " - [14] " step_normalize(all_numeric_predictors()) " - [15] "" - [16] "test_config_25_dummies_spec <- " - [17] " nearest_neighbor(neighbors = tune(), weight_func = tune()) %>% " - [18] " set_mode(\"regression\") %>% " - [19] " set_engine(\"kknn\") " - [20] "" - [21] "test_config_25_dummies_workflow <- " - [22] " workflow() %>% " - [23] " add_recipe(test_config_25_dummies_recipe) %>% " - [24] " add_model(test_config_25_dummies_spec) " - [25] "" - [26] "set.seed(27246)" - [27] "test_config_25_dummies_tune <-" - [28] " tune_grid(test_config_25_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [29] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_25_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " ## This model requires the predictors to be numeric. The most common " - [5] " ## method to convert qualitative predictors to numeric is to create " - [6] " ## binary indicator variables (aka dummy variables) from these " - [7] " ## predictors. " - [8] " step_dummy(all_nominal_predictors()) %>% " - [9] " ## Since distance calculations are used, the predictor variables should " - [10] " ## be on the same scale. Before centering and scaling the numeric " - [11] " ## predictors, any predictors with a single unique value are filtered " - [12] " ## out. " - [13] " step_zv(all_predictors()) %>% " - [14] " step_normalize(all_numeric_predictors()) " - [15] "" - [16] "test_config_25_no_dummies_spec <- " - [17] " nearest_neighbor(neighbors = tune(), weight_func = tune()) %>% " - [18] " set_mode(\"classification\") %>% " - [19] " set_engine(\"kknn\") " - [20] "" - [21] "test_config_25_no_dummies_workflow <- " - [22] " workflow() %>% " - [23] " add_recipe(test_config_25_no_dummies_recipe) %>% " - [24] " add_model(test_config_25_no_dummies_spec) " - [25] "" - [26] "set.seed(27246)" - [27] "test_config_25_no_dummies_tune <-" - [28] " tune_grid(test_config_25_no_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [29] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_26_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) " - [3] "" - [4] "test_config_26_dummies_spec <- " - [5] " gen_additive_mod(select_features = tune(), adjust_deg_free = tune()) %>% " - [6] " set_mode(\"regression\") %>% " - [7] " set_engine(\"mgcv\") " - [8] "" - [9] "test_config_26_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_26_dummies_recipe) %>% " - [12] " add_model(test_config_26_dummies_spec, formula = stop(\"add your gam formula\")) " - [13] "" - [14] "set.seed(27246)" - [15] "test_config_26_dummies_tune <-" - [16] " tune_grid(test_config_26_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [17] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_26_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) " - [3] "" - [4] "test_config_26_no_dummies_spec <- " - [5] " gen_additive_mod(select_features = tune(), adjust_deg_free = tune()) %>% " - [6] " set_mode(\"classification\") %>% " - [7] " set_engine(\"mgcv\") " - [8] "" - [9] "test_config_26_no_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_26_no_dummies_recipe) %>% " - [12] " add_model(test_config_26_no_dummies_spec, formula = stop(\"add your gam formula\")) " - [13] "" - [14] "set.seed(27246)" - [15] "test_config_26_no_dummies_tune <-" - [16] " tune_grid(test_config_26_no_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [17] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "library(plsmod)" - [2] "" - [3] "test_config_27_dummies_recipe <- " - [4] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [5] " step_novel(all_nominal_predictors()) %>% " - [6] " ## This model requires the predictors to be numeric. The most common " - [7] " ## method to convert qualitative predictors to numeric is to create " - [8] " ## binary indicator variables (aka dummy variables) from these " - [9] " ## predictors. " - [10] " step_dummy(all_nominal_predictors()) %>% " - [11] " step_zv(all_predictors()) %>% " - [12] " step_normalize(all_numeric_predictors()) " - [13] "" - [14] "test_config_27_dummies_spec <- " - [15] " pls(predictor_prop = tune(), num_comp = tune()) %>% " - [16] " set_mode(\"regression\") %>% " - [17] " set_engine(\"mixOmics\") " - [18] "" - [19] "test_config_27_dummies_workflow <- " - [20] " workflow() %>% " - [21] " add_recipe(test_config_27_dummies_recipe) %>% " - [22] " add_model(test_config_27_dummies_spec) " - [23] "" - [24] "set.seed(27246)" - [25] "test_config_27_dummies_tune <-" - [26] " tune_grid(test_config_27_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [27] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "library(plsmod)" - [2] "" - [3] "test_config_27_no_dummies_recipe <- " - [4] " recipe(formula = species ~ ., data = penguins) %>% " - [5] " step_novel(all_nominal_predictors()) %>% " - [6] " ## This model requires the predictors to be numeric. The most common " - [7] " ## method to convert qualitative predictors to numeric is to create " - [8] " ## binary indicator variables (aka dummy variables) from these " - [9] " ## predictors. " - [10] " step_dummy(all_nominal_predictors()) %>% " - [11] " step_zv(all_predictors()) %>% " - [12] " step_normalize(all_numeric_predictors()) " - [13] "" - [14] "test_config_27_no_dummies_spec <- " - [15] " pls(predictor_prop = tune(), num_comp = tune()) %>% " - [16] " set_mode(\"classification\") %>% " - [17] " set_engine(\"mixOmics\") " - [18] "" - [19] "test_config_27_no_dummies_workflow <- " - [20] " workflow() %>% " - [21] " add_recipe(test_config_27_no_dummies_recipe) %>% " - [22] " add_model(test_config_27_no_dummies_spec) " - [23] "" - [24] "set.seed(27246)" - [25] "test_config_27_no_dummies_tune <-" - [26] " tune_grid(test_config_27_no_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [27] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_28_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " ## This model requires the predictors to be numeric. The most common " - [5] " ## method to convert qualitative predictors to numeric is to create " - [6] " ## binary indicator variables (aka dummy variables) from these " - [7] " ## predictors. " - [8] " step_dummy(all_nominal_predictors()) %>% " - [9] " step_zv(all_predictors()) %>% " - [10] " step_normalize(all_numeric_predictors()) " - [11] "" - [12] "test_config_28_dummies_spec <- " - [13] " mlp(hidden_units = tune(), penalty = tune(), epochs = tune()) %>% " - [14] " set_mode(\"regression\") " - [15] "" - [16] "test_config_28_dummies_workflow <- " - [17] " workflow() %>% " - [18] " add_recipe(test_config_28_dummies_recipe) %>% " - [19] " add_model(test_config_28_dummies_spec) " - [20] "" - [21] "set.seed(27246)" - [22] "test_config_28_dummies_tune <-" - [23] " tune_grid(test_config_28_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [24] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_28_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " ## This model requires the predictors to be numeric. The most common " - [5] " ## method to convert qualitative predictors to numeric is to create " - [6] " ## binary indicator variables (aka dummy variables) from these " - [7] " ## predictors. " - [8] " step_dummy(all_nominal_predictors()) %>% " - [9] " step_zv(all_predictors()) %>% " - [10] " step_normalize(all_numeric_predictors()) " - [11] "" - [12] "test_config_28_no_dummies_spec <- " - [13] " mlp(hidden_units = tune(), penalty = tune(), epochs = tune()) %>% " - [14] " set_mode(\"classification\") " - [15] "" - [16] "test_config_28_no_dummies_workflow <- " - [17] " workflow() %>% " - [18] " add_recipe(test_config_28_no_dummies_recipe) %>% " - [19] " add_model(test_config_28_no_dummies_spec) " - [20] "" - [21] "set.seed(27246)" - [22] "test_config_28_no_dummies_tune <-" - [23] " tune_grid(test_config_28_no_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [24] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_29_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) " - [3] "" - [4] "test_config_29_dummies_spec <- " - [5] " rand_forest(mtry = tune(), min_n = tune(), trees = 1000) %>% " - [6] " set_mode(\"regression\") %>% " - [7] " set_engine(\"ranger\") " - [8] "" - [9] "test_config_29_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_29_dummies_recipe) %>% " - [12] " add_model(test_config_29_dummies_spec) " - [13] "" - [14] "set.seed(27246)" - [15] "test_config_29_dummies_tune <-" - [16] " tune_grid(test_config_29_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [17] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_29_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) " - [3] "" - [4] "test_config_29_no_dummies_spec <- " - [5] " rand_forest(mtry = tune(), min_n = tune(), trees = 1000) %>% " - [6] " set_mode(\"classification\") %>% " - [7] " set_engine(\"ranger\") " - [8] "" - [9] "test_config_29_no_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_29_no_dummies_recipe) %>% " - [12] " add_model(test_config_29_no_dummies_spec) " - [13] "" - [14] "set.seed(27246)" - [15] "test_config_29_no_dummies_tune <-" - [16] " tune_grid(test_config_29_no_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [17] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_30_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) " - [3] "" - [4] "test_config_30_dummies_spec <- " - [5] " decision_tree(tree_depth = tune(), min_n = tune(), cost_complexity = tune()) %>% " - [6] " set_mode(\"regression\") %>% " - [7] " set_engine(\"rpart\") " - [8] "" - [9] "test_config_30_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_30_dummies_recipe) %>% " - [12] " add_model(test_config_30_dummies_spec) " - [13] "" - [14] "set.seed(27246)" - [15] "test_config_30_dummies_tune <-" - [16] " tune_grid(test_config_30_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [17] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_30_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) " - [3] "" - [4] "test_config_30_no_dummies_spec <- " - [5] " decision_tree(tree_depth = tune(), min_n = tune(), cost_complexity = tune()) %>% " - [6] " set_mode(\"classification\") %>% " - [7] " set_engine(\"rpart\") " - [8] "" - [9] "test_config_30_no_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_30_no_dummies_recipe) %>% " - [12] " add_model(test_config_30_no_dummies_spec) " - [13] "" - [14] "set.seed(27246)" - [15] "test_config_30_no_dummies_tune <-" - [16] " tune_grid(test_config_30_no_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [17] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_31_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " ## This model requires the predictors to be numeric. The most common " - [5] " ## method to convert qualitative predictors to numeric is to create " - [6] " ## binary indicator variables (aka dummy variables) from these " - [7] " ## predictors. However, for this model, binary indicator variables can be " - [8] " ## made for each of the levels of the factors (known as 'one-hot " - [9] " ## encoding'). " - [10] " step_dummy(all_nominal_predictors(), one_hot = TRUE) %>% " - [11] " step_zv(all_predictors()) " - [12] "" - [13] "test_config_31_dummies_spec <- " - [14] " boost_tree(trees = tune(), min_n = tune(), tree_depth = tune(), learn_rate = tune(), " - [15] " loss_reduction = tune(), sample_size = tune()) %>% " - [16] " set_mode(\"regression\") %>% " - [17] " set_engine(\"xgboost\") " - [18] "" - [19] "test_config_31_dummies_workflow <- " - [20] " workflow() %>% " - [21] " add_recipe(test_config_31_dummies_recipe) %>% " - [22] " add_model(test_config_31_dummies_spec) " - [23] "" - [24] "set.seed(27246)" - [25] "test_config_31_dummies_tune <-" - [26] " tune_grid(test_config_31_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [27] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_31_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " ## This model requires the predictors to be numeric. The most common " - [5] " ## method to convert qualitative predictors to numeric is to create " - [6] " ## binary indicator variables (aka dummy variables) from these " - [7] " ## predictors. However, for this model, binary indicator variables can be " - [8] " ## made for each of the levels of the factors (known as 'one-hot " - [9] " ## encoding'). " - [10] " step_dummy(all_nominal_predictors(), one_hot = TRUE) %>% " - [11] " step_zv(all_predictors()) " - [12] "" - [13] "test_config_31_no_dummies_spec <- " - [14] " boost_tree(trees = tune(), min_n = tune(), tree_depth = tune(), learn_rate = tune(), " - [15] " loss_reduction = tune(), sample_size = tune()) %>% " - [16] " set_mode(\"classification\") %>% " - [17] " set_engine(\"xgboost\") " - [18] "" - [19] "test_config_31_no_dummies_workflow <- " - [20] " workflow() %>% " - [21] " add_recipe(test_config_31_no_dummies_recipe) %>% " - [22] " add_model(test_config_31_no_dummies_spec) " - [23] "" - [24] "set.seed(27246)" - [25] "test_config_31_no_dummies_tune <-" - [26] " tune_grid(test_config_31_no_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [27] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "library(rules)" - [2] "" - [3] "test_config_32_dummies_recipe <- " - [4] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [5] " step_novel(all_nominal_predictors()) %>% " - [6] " ## This model requires the predictors to be numeric. The most common " - [7] " ## method to convert qualitative predictors to numeric is to create " - [8] " ## binary indicator variables (aka dummy variables) from these " - [9] " ## predictors. " - [10] " step_dummy(all_nominal_predictors()) %>% " - [11] " step_zv(all_predictors()) %>% " - [12] " step_normalize(all_numeric_predictors()) " - [13] "" - [14] "test_config_32_dummies_spec <- " - [15] " rule_fit(mtry = tune(), trees = tune(), min_n = tune(), tree_depth = tune(), " - [16] " learn_rate = tune(), loss_reduction = tune(), sample_size = tune(), penalty = tune()) %>% " - [17] " set_mode(\"regression\") %>% " - [18] " set_engine(\"xrf\") " - [19] "" - [20] "test_config_32_dummies_workflow <- " - [21] " workflow() %>% " - [22] " add_recipe(test_config_32_dummies_recipe) %>% " - [23] " add_model(test_config_32_dummies_spec) " - [24] "" - [25] "set.seed(27246)" - [26] "test_config_32_dummies_tune <-" - [27] " tune_grid(test_config_32_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [28] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "library(rules)" - [2] "" - [3] "test_config_32_no_dummies_recipe <- " - [4] " recipe(formula = species ~ ., data = penguins) %>% " - [5] " step_novel(all_nominal_predictors()) %>% " - [6] " ## This model requires the predictors to be numeric. The most common " - [7] " ## method to convert qualitative predictors to numeric is to create " - [8] " ## binary indicator variables (aka dummy variables) from these " - [9] " ## predictors. " - [10] " step_dummy(all_nominal_predictors()) %>% " - [11] " step_zv(all_predictors()) %>% " - [12] " step_normalize(all_numeric_predictors()) " - [13] "" - [14] "test_config_32_no_dummies_spec <- " - [15] " rule_fit(mtry = tune(), trees = tune(), min_n = tune(), tree_depth = tune(), " - [16] " learn_rate = tune(), loss_reduction = tune(), sample_size = tune(), penalty = tune()) %>% " - [17] " set_mode(\"classification\") %>% " - [18] " set_engine(\"xrf\") " - [19] "" - [20] "test_config_32_no_dummies_workflow <- " - [21] " workflow() %>% " - [22] " add_recipe(test_config_32_no_dummies_recipe) %>% " - [23] " add_model(test_config_32_no_dummies_spec) " - [24] "" - [25] "set.seed(27246)" - [26] "test_config_32_no_dummies_tune <-" - [27] " tune_grid(test_config_32_no_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [28] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "library(baguette)" - [2] "" - [3] "test_config_33_dummies_recipe <- " - [4] " recipe(formula = body_mass_g ~ ., data = penguins) " - [5] "" - [6] "test_config_33_dummies_spec <- " - [7] " bag_tree() %>% " - [8] " set_mode(\"regression\") %>% " - [9] " set_engine(\"rpart\") " - [10] "" - [11] "test_config_33_dummies_workflow <- " - [12] " workflow() %>% " - [13] " add_recipe(test_config_33_dummies_recipe) %>% " - [14] " add_model(test_config_33_dummies_spec) " - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "library(baguette)" - [2] "" - [3] "test_config_33_no_dummies_recipe <- " - [4] " recipe(formula = species ~ ., data = penguins) " - [5] "" - [6] "test_config_33_no_dummies_spec <- " - [7] " bag_tree() %>% " - [8] " set_mode(\"classification\") %>% " - [9] " set_engine(\"rpart\") " - [10] "" - [11] "test_config_33_no_dummies_workflow <- " - [12] " workflow() %>% " - [13] " add_recipe(test_config_33_no_dummies_recipe) %>% " - [14] " add_model(test_config_33_no_dummies_spec) " - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_34_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) " - [3] "" - [4] "test_config_34_no_dummies_spec <- " - [5] " boost_tree() %>% " - [6] " set_mode(\"classification\") %>% " - [7] " set_engine(\"C5.0\") " - [8] "" - [9] "test_config_34_no_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_34_no_dummies_recipe) %>% " - [12] " add_model(test_config_34_no_dummies_spec) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "library(rules)" - [2] "" - [3] "test_config_35_dummies_recipe <- " - [4] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [5] " step_zv(all_predictors()) " - [6] "" - [7] "test_config_35_dummies_spec <- " - [8] " cubist_rules() %>% " - [9] " set_engine(\"Cubist\") " - [10] "" - [11] "test_config_35_dummies_workflow <- " - [12] " workflow() %>% " - [13] " add_recipe(test_config_35_dummies_recipe) %>% " - [14] " add_model(test_config_35_dummies_spec) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_36_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) " - [3] "" - [4] "test_config_36_dummies_spec <- " - [5] " bart() %>% " - [6] " set_mode(\"regression\") %>% " - [7] " set_engine(\"dbarts\") " - [8] "" - [9] "test_config_36_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_36_dummies_recipe) %>% " - [12] " add_model(test_config_36_dummies_spec) " - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_36_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) " - [3] "" - [4] "test_config_36_no_dummies_spec <- " - [5] " bart() %>% " - [6] " set_mode(\"classification\") %>% " - [7] " set_engine(\"dbarts\") " - [8] "" - [9] "test_config_36_no_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_36_no_dummies_recipe) %>% " - [12] " add_model(test_config_36_no_dummies_spec) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_37_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " step_dummy(all_nominal_predictors()) %>% " - [5] " step_zv(all_predictors()) " - [6] "" - [7] "test_config_37_dummies_spec <- " - [8] " mars() %>% " - [9] " set_mode(\"regression\") %>% " - [10] " set_engine(\"earth\") " - [11] "" - [12] "test_config_37_dummies_workflow <- " - [13] " workflow() %>% " - [14] " add_recipe(test_config_37_dummies_recipe) %>% " - [15] " add_model(test_config_37_dummies_spec) " - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_37_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " step_dummy(all_nominal_predictors()) %>% " - [5] " step_zv(all_predictors()) " - [6] "" - [7] "test_config_37_no_dummies_spec <- " - [8] " mars() %>% " - [9] " set_mode(\"classification\") %>% " - [10] " set_engine(\"earth\") " - [11] "" - [12] "test_config_37_no_dummies_workflow <- " - [13] " workflow() %>% " - [14] " add_recipe(test_config_37_no_dummies_recipe) %>% " - [15] " add_model(test_config_37_no_dummies_spec) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_38_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " step_dummy(all_nominal_predictors()) %>% " - [5] " step_zv(all_predictors()) %>% " - [6] " step_normalize(all_numeric_predictors()) " - [7] "" - [8] "test_config_38_dummies_spec <- " - [9] " linear_reg() %>% " - [10] " set_mode(\"regression\") %>% " - [11] " set_engine(\"glmnet\") " - [12] "" - [13] "test_config_38_dummies_workflow <- " - [14] " workflow() %>% " - [15] " add_recipe(test_config_38_dummies_recipe) %>% " - [16] " add_model(test_config_38_dummies_spec) " - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_38_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " step_dummy(all_nominal_predictors()) %>% " - [5] " step_zv(all_predictors()) %>% " - [6] " step_normalize(all_numeric_predictors()) " - [7] "" - [8] "test_config_38_no_dummies_spec <- " - [9] " multinom_reg() %>% " - [10] " set_mode(\"classification\") %>% " - [11] " set_engine(\"glmnet\") " - [12] "" - [13] "test_config_38_no_dummies_workflow <- " - [14] " workflow() %>% " - [15] " add_recipe(test_config_38_no_dummies_recipe) %>% " - [16] " add_model(test_config_38_no_dummies_spec) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_39_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [3] " step_zv(all_predictors()) %>% " - [4] " step_normalize(all_numeric_predictors()) " - [5] "" - [6] "test_config_39_dummies_spec <- " - [7] " svm_poly() %>% " - [8] " set_mode(\"regression\") " - [9] "" - [10] "test_config_39_dummies_workflow <- " - [11] " workflow() %>% " - [12] " add_recipe(test_config_39_dummies_recipe) %>% " - [13] " add_model(test_config_39_dummies_spec) " - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_39_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) %>% " - [3] " step_zv(all_predictors()) %>% " - [4] " step_normalize(all_numeric_predictors()) " - [5] "" - [6] "test_config_39_no_dummies_spec <- " - [7] " svm_poly() %>% " - [8] " set_mode(\"classification\") " - [9] "" - [10] "test_config_39_no_dummies_workflow <- " - [11] " workflow() %>% " - [12] " add_recipe(test_config_39_no_dummies_recipe) %>% " - [13] " add_model(test_config_39_no_dummies_spec) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_40_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [3] " step_zv(all_predictors()) %>% " - [4] " step_normalize(all_numeric_predictors()) " - [5] "" - [6] "test_config_40_dummies_spec <- " - [7] " svm_rbf() %>% " - [8] " set_mode(\"regression\") " - [9] "" - [10] "test_config_40_dummies_workflow <- " - [11] " workflow() %>% " - [12] " add_recipe(test_config_40_dummies_recipe) %>% " - [13] " add_model(test_config_40_dummies_spec) " - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_40_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) %>% " - [3] " step_zv(all_predictors()) %>% " - [4] " step_normalize(all_numeric_predictors()) " - [5] "" - [6] "test_config_40_no_dummies_spec <- " - [7] " svm_rbf() %>% " - [8] " set_mode(\"classification\") " - [9] "" - [10] "test_config_40_no_dummies_workflow <- " - [11] " workflow() %>% " - [12] " add_recipe(test_config_40_no_dummies_recipe) %>% " - [13] " add_model(test_config_40_no_dummies_spec) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_41_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " step_dummy(all_nominal_predictors()) %>% " - [5] " step_zv(all_predictors()) %>% " - [6] " step_normalize(all_numeric_predictors()) " - [7] "" - [8] "test_config_41_dummies_spec <- " - [9] " nearest_neighbor() %>% " - [10] " set_mode(\"regression\") %>% " - [11] " set_engine(\"kknn\") " - [12] "" - [13] "test_config_41_dummies_workflow <- " - [14] " workflow() %>% " - [15] " add_recipe(test_config_41_dummies_recipe) %>% " - [16] " add_model(test_config_41_dummies_spec) " - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_41_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " step_dummy(all_nominal_predictors()) %>% " - [5] " step_zv(all_predictors()) %>% " - [6] " step_normalize(all_numeric_predictors()) " - [7] "" - [8] "test_config_41_no_dummies_spec <- " - [9] " nearest_neighbor() %>% " - [10] " set_mode(\"classification\") %>% " - [11] " set_engine(\"kknn\") " - [12] "" - [13] "test_config_41_no_dummies_workflow <- " - [14] " workflow() %>% " - [15] " add_recipe(test_config_41_no_dummies_recipe) %>% " - [16] " add_model(test_config_41_no_dummies_spec) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_42_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) " - [3] "" - [4] "test_config_42_dummies_spec <- " - [5] " gen_additive_mod() %>% " - [6] " set_mode(\"regression\") %>% " - [7] " set_engine(\"mgcv\") " - [8] "" - [9] "test_config_42_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_42_dummies_recipe) %>% " - [12] " add_model(test_config_42_dummies_spec, formula = stop(\"add your gam formula\")) " - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_42_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) " - [3] "" - [4] "test_config_42_no_dummies_spec <- " - [5] " gen_additive_mod() %>% " - [6] " set_mode(\"classification\") %>% " - [7] " set_engine(\"mgcv\") " - [8] "" - [9] "test_config_42_no_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_42_no_dummies_recipe) %>% " - [12] " add_model(test_config_42_no_dummies_spec, formula = stop(\"add your gam formula\")) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "library(plsmod)" - [2] "" - [3] "test_config_43_dummies_recipe <- " - [4] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [5] " step_novel(all_nominal_predictors()) %>% " - [6] " step_dummy(all_nominal_predictors()) %>% " - [7] " step_zv(all_predictors()) %>% " - [8] " step_normalize(all_numeric_predictors()) " - [9] "" - [10] "test_config_43_dummies_spec <- " - [11] " pls() %>% " - [12] " set_mode(\"regression\") %>% " - [13] " set_engine(\"mixOmics\") " - [14] "" - [15] "test_config_43_dummies_workflow <- " - [16] " workflow() %>% " - [17] " add_recipe(test_config_43_dummies_recipe) %>% " - [18] " add_model(test_config_43_dummies_spec) " - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "library(plsmod)" - [2] "" - [3] "test_config_43_no_dummies_recipe <- " - [4] " recipe(formula = species ~ ., data = penguins) %>% " - [5] " step_novel(all_nominal_predictors()) %>% " - [6] " step_dummy(all_nominal_predictors()) %>% " - [7] " step_zv(all_predictors()) %>% " - [8] " step_normalize(all_numeric_predictors()) " - [9] "" - [10] "test_config_43_no_dummies_spec <- " - [11] " pls() %>% " - [12] " set_mode(\"classification\") %>% " - [13] " set_engine(\"mixOmics\") " - [14] "" - [15] "test_config_43_no_dummies_workflow <- " - [16] " workflow() %>% " - [17] " add_recipe(test_config_43_no_dummies_recipe) %>% " - [18] " add_model(test_config_43_no_dummies_spec) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_44_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " step_dummy(all_nominal_predictors()) %>% " - [5] " step_zv(all_predictors()) %>% " - [6] " step_normalize(all_numeric_predictors()) " - [7] "" - [8] "test_config_44_dummies_spec <- " - [9] " mlp() %>% " - [10] " set_mode(\"regression\") " - [11] "" - [12] "test_config_44_dummies_workflow <- " - [13] " workflow() %>% " - [14] " add_recipe(test_config_44_dummies_recipe) %>% " - [15] " add_model(test_config_44_dummies_spec) " - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_44_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " step_dummy(all_nominal_predictors()) %>% " - [5] " step_zv(all_predictors()) %>% " - [6] " step_normalize(all_numeric_predictors()) " - [7] "" - [8] "test_config_44_no_dummies_spec <- " - [9] " mlp() %>% " - [10] " set_mode(\"classification\") " - [11] "" - [12] "test_config_44_no_dummies_workflow <- " - [13] " workflow() %>% " - [14] " add_recipe(test_config_44_no_dummies_recipe) %>% " - [15] " add_model(test_config_44_no_dummies_spec) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_45_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) " - [3] "" - [4] "test_config_45_dummies_spec <- " - [5] " rand_forest(trees = 1000) %>% " - [6] " set_mode(\"regression\") %>% " - [7] " set_engine(\"ranger\") " - [8] "" - [9] "test_config_45_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_45_dummies_recipe) %>% " - [12] " add_model(test_config_45_dummies_spec) " - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_45_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) " - [3] "" - [4] "test_config_45_no_dummies_spec <- " - [5] " rand_forest(trees = 1000) %>% " - [6] " set_mode(\"classification\") %>% " - [7] " set_engine(\"ranger\") " - [8] "" - [9] "test_config_45_no_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_45_no_dummies_recipe) %>% " - [12] " add_model(test_config_45_no_dummies_spec) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_46_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) " - [3] "" - [4] "test_config_46_dummies_spec <- " - [5] " decision_tree() %>% " - [6] " set_mode(\"regression\") %>% " - [7] " set_engine(\"rpart\") " - [8] "" - [9] "test_config_46_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_46_dummies_recipe) %>% " - [12] " add_model(test_config_46_dummies_spec) " - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_46_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) " - [3] "" - [4] "test_config_46_no_dummies_spec <- " - [5] " decision_tree() %>% " - [6] " set_mode(\"classification\") %>% " - [7] " set_engine(\"rpart\") " - [8] "" - [9] "test_config_46_no_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_46_no_dummies_recipe) %>% " - [12] " add_model(test_config_46_no_dummies_spec) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_47_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " step_dummy(all_nominal_predictors(), one_hot = TRUE) %>% " - [5] " step_zv(all_predictors()) " - [6] "" - [7] "test_config_47_dummies_spec <- " - [8] " boost_tree() %>% " - [9] " set_mode(\"regression\") %>% " - [10] " set_engine(\"xgboost\") " - [11] "" - [12] "test_config_47_dummies_workflow <- " - [13] " workflow() %>% " - [14] " add_recipe(test_config_47_dummies_recipe) %>% " - [15] " add_model(test_config_47_dummies_spec) " - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_47_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " step_dummy(all_nominal_predictors(), one_hot = TRUE) %>% " - [5] " step_zv(all_predictors()) " - [6] "" - [7] "test_config_47_no_dummies_spec <- " - [8] " boost_tree() %>% " - [9] " set_mode(\"classification\") %>% " - [10] " set_engine(\"xgboost\") " - [11] "" - [12] "test_config_47_no_dummies_workflow <- " - [13] " workflow() %>% " - [14] " add_recipe(test_config_47_no_dummies_recipe) %>% " - [15] " add_model(test_config_47_no_dummies_spec) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "library(rules)" - [2] "" - [3] "test_config_48_dummies_recipe <- " - [4] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [5] " step_novel(all_nominal_predictors()) %>% " - [6] " step_dummy(all_nominal_predictors()) %>% " - [7] " step_zv(all_predictors()) %>% " - [8] " step_normalize(all_numeric_predictors()) " - [9] "" - [10] "test_config_48_dummies_spec <- " - [11] " rule_fit() %>% " - [12] " set_mode(\"regression\") %>% " - [13] " set_engine(\"xrf\") " - [14] "" - [15] "test_config_48_dummies_workflow <- " - [16] " workflow() %>% " - [17] " add_recipe(test_config_48_dummies_recipe) %>% " - [18] " add_model(test_config_48_dummies_spec) " - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "library(rules)" - [2] "" - [3] "test_config_48_no_dummies_recipe <- " - [4] " recipe(formula = species ~ ., data = penguins) %>% " - [5] " step_novel(all_nominal_predictors()) %>% " - [6] " step_dummy(all_nominal_predictors()) %>% " - [7] " step_zv(all_predictors()) %>% " - [8] " step_normalize(all_numeric_predictors()) " - [9] "" - [10] "test_config_48_no_dummies_spec <- " - [11] " rule_fit() %>% " - [12] " set_mode(\"classification\") %>% " - [13] " set_engine(\"xrf\") " - [14] "" - [15] "test_config_48_no_dummies_workflow <- " - [16] " workflow() %>% " - [17] " add_recipe(test_config_48_no_dummies_recipe) %>% " - [18] " add_model(test_config_48_no_dummies_spec) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "library(baguette)" - [2] "" - [3] "test_config_49_dummies_recipe <- " - [4] " recipe(formula = body_mass_g ~ ., data = penguins) " - [5] "" - [6] "test_config_49_dummies_spec <- " - [7] " bag_tree(tree_depth = tune(), min_n = tune(), cost_complexity = tune()) %>% " - [8] " set_mode(\"regression\") %>% " - [9] " set_engine(\"rpart\") " - [10] "" - [11] "test_config_49_dummies_workflow <- " - [12] " workflow() %>% " - [13] " add_recipe(test_config_49_dummies_recipe) %>% " - [14] " add_model(test_config_49_dummies_spec) " - [15] "" - [16] "set.seed(27246)" - [17] "test_config_49_dummies_tune <-" - [18] " tune_grid(test_config_49_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [19] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "library(baguette)" - [2] "" - [3] "test_config_49_no_dummies_recipe <- " - [4] " recipe(formula = species ~ ., data = penguins) " - [5] "" - [6] "test_config_49_no_dummies_spec <- " - [7] " bag_tree(tree_depth = tune(), min_n = tune(), cost_complexity = tune()) %>% " - [8] " set_mode(\"classification\") %>% " - [9] " set_engine(\"rpart\") " - [10] "" - [11] "test_config_49_no_dummies_workflow <- " - [12] " workflow() %>% " - [13] " add_recipe(test_config_49_no_dummies_recipe) %>% " - [14] " add_model(test_config_49_no_dummies_spec) " - [15] "" - [16] "set.seed(27246)" - [17] "test_config_49_no_dummies_tune <-" - [18] " tune_grid(test_config_49_no_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [19] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_50_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) " - [3] "" - [4] "test_config_50_no_dummies_spec <- " - [5] " boost_tree(trees = tune(), min_n = tune()) %>% " - [6] " set_mode(\"classification\") %>% " - [7] " set_engine(\"C5.0\") " - [8] "" - [9] "test_config_50_no_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_50_no_dummies_recipe) %>% " - [12] " add_model(test_config_50_no_dummies_spec) " - [13] "" - [14] "set.seed(27246)" - [15] "test_config_50_no_dummies_tune <-" - [16] " tune_grid(test_config_50_no_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [17] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "library(rules)" - [2] "" - [3] "test_config_51_dummies_recipe <- " - [4] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [5] " step_zv(all_predictors()) " - [6] "" - [7] "test_config_51_dummies_spec <- " - [8] " cubist_rules(committees = tune(), neighbors = tune()) %>% " - [9] " set_engine(\"Cubist\") " - [10] "" - [11] "test_config_51_dummies_workflow <- " - [12] " workflow() %>% " - [13] " add_recipe(test_config_51_dummies_recipe) %>% " - [14] " add_model(test_config_51_dummies_spec) " - [15] "" - [16] "test_config_51_dummies_grid <- tidyr::crossing(committees = c(1:9, (1:5) * " - [17] " 10), neighbors = c(0, 3, 6, 9)) " - [18] "" - [19] "test_config_51_dummies_tune <- " - [20] " tune_grid(test_config_51_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [21] " grid = test_config_51_dummies_grid) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_52_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) " - [3] "" - [4] "test_config_52_dummies_spec <- " - [5] " bart(trees = tune(), prior_terminal_node_coef = tune(), prior_terminal_node_expo = tune()) %>% " - [6] " set_mode(\"regression\") %>% " - [7] " set_engine(\"dbarts\") " - [8] "" - [9] "test_config_52_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_52_dummies_recipe) %>% " - [12] " add_model(test_config_52_dummies_spec) " - [13] "" - [14] "set.seed(27246)" - [15] "test_config_52_dummies_tune <-" - [16] " tune_grid(test_config_52_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [17] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_52_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) " - [3] "" - [4] "test_config_52_no_dummies_spec <- " - [5] " bart(trees = tune(), prior_terminal_node_coef = tune(), prior_terminal_node_expo = tune()) %>% " - [6] " set_mode(\"classification\") %>% " - [7] " set_engine(\"dbarts\") " - [8] "" - [9] "test_config_52_no_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_52_no_dummies_recipe) %>% " - [12] " add_model(test_config_52_no_dummies_spec) " - [13] "" - [14] "set.seed(27246)" - [15] "test_config_52_no_dummies_tune <-" - [16] " tune_grid(test_config_52_no_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [17] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_53_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " step_dummy(all_nominal_predictors()) %>% " - [5] " step_zv(all_predictors()) " - [6] "" - [7] "test_config_53_dummies_spec <- " - [8] " mars(num_terms = tune(), prod_degree = tune(), prune_method = \"none\") %>% " - [9] " set_mode(\"regression\") %>% " - [10] " set_engine(\"earth\") " - [11] "" - [12] "test_config_53_dummies_workflow <- " - [13] " workflow() %>% " - [14] " add_recipe(test_config_53_dummies_recipe) %>% " - [15] " add_model(test_config_53_dummies_spec) " - [16] "" - [17] "test_config_53_dummies_grid <- tidyr::crossing(num_terms = 2 * (1:6), prod_degree = 1:2) " - [18] "" - [19] "test_config_53_dummies_tune <- " - [20] " tune_grid(test_config_53_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [21] " grid = test_config_53_dummies_grid) " - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_53_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " step_dummy(all_nominal_predictors()) %>% " - [5] " step_zv(all_predictors()) " - [6] "" - [7] "test_config_53_no_dummies_spec <- " - [8] " mars(num_terms = tune(), prod_degree = tune(), prune_method = \"none\") %>% " - [9] " set_mode(\"classification\") %>% " - [10] " set_engine(\"earth\") " - [11] "" - [12] "test_config_53_no_dummies_workflow <- " - [13] " workflow() %>% " - [14] " add_recipe(test_config_53_no_dummies_recipe) %>% " - [15] " add_model(test_config_53_no_dummies_spec) " - [16] "" - [17] "test_config_53_no_dummies_grid <- tidyr::crossing(num_terms = 2 * (1:6), prod_degree = 1:2) " - [18] "" - [19] "test_config_53_no_dummies_tune <- " - [20] " tune_grid(test_config_53_no_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [21] " grid = test_config_53_no_dummies_grid) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_54_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " step_dummy(all_nominal_predictors()) %>% " - [5] " step_zv(all_predictors()) %>% " - [6] " step_normalize(all_numeric_predictors()) " - [7] "" - [8] "test_config_54_dummies_spec <- " - [9] " linear_reg(penalty = tune(), mixture = tune()) %>% " - [10] " set_mode(\"regression\") %>% " - [11] " set_engine(\"glmnet\") " - [12] "" - [13] "test_config_54_dummies_workflow <- " - [14] " workflow() %>% " - [15] " add_recipe(test_config_54_dummies_recipe) %>% " - [16] " add_model(test_config_54_dummies_spec) " - [17] "" - [18] "test_config_54_dummies_grid <- tidyr::crossing(penalty = 10^seq(-6, -1, length.out = 20), " - [19] " mixture = c(0.05, 0.2, 0.4, 0.6, 0.8, 1)) " - [20] "" - [21] "test_config_54_dummies_tune <- " - [22] " tune_grid(test_config_54_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [23] " grid = test_config_54_dummies_grid) " - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_54_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " step_dummy(all_nominal_predictors()) %>% " - [5] " step_zv(all_predictors()) %>% " - [6] " step_normalize(all_numeric_predictors()) " - [7] "" - [8] "test_config_54_no_dummies_spec <- " - [9] " multinom_reg(penalty = tune(), mixture = tune()) %>% " - [10] " set_mode(\"classification\") %>% " - [11] " set_engine(\"glmnet\") " - [12] "" - [13] "test_config_54_no_dummies_workflow <- " - [14] " workflow() %>% " - [15] " add_recipe(test_config_54_no_dummies_recipe) %>% " - [16] " add_model(test_config_54_no_dummies_spec) " - [17] "" - [18] "test_config_54_no_dummies_grid <- tidyr::crossing(penalty = 10^seq(-6, -1, " - [19] " length.out = 20), mixture = c(0.05, 0.2, 0.4, 0.6, 0.8, 1)) " - [20] "" - [21] "test_config_54_no_dummies_tune <- " - [22] " tune_grid(test_config_54_no_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [23] " grid = test_config_54_no_dummies_grid) " - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_55_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [3] " step_zv(all_predictors()) %>% " - [4] " step_normalize(all_numeric_predictors()) " - [5] "" - [6] "test_config_55_dummies_spec <- " - [7] " svm_poly(cost = tune(), degree = tune(), scale_factor = tune()) %>% " - [8] " set_mode(\"regression\") " - [9] "" - [10] "test_config_55_dummies_workflow <- " - [11] " workflow() %>% " - [12] " add_recipe(test_config_55_dummies_recipe) %>% " - [13] " add_model(test_config_55_dummies_spec) " - [14] "" - [15] "set.seed(27246)" - [16] "test_config_55_dummies_tune <-" - [17] " tune_grid(test_config_55_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [18] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_55_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) %>% " - [3] " step_zv(all_predictors()) %>% " - [4] " step_normalize(all_numeric_predictors()) " - [5] "" - [6] "test_config_55_no_dummies_spec <- " - [7] " svm_poly(cost = tune(), degree = tune(), scale_factor = tune()) %>% " - [8] " set_mode(\"classification\") " - [9] "" - [10] "test_config_55_no_dummies_workflow <- " - [11] " workflow() %>% " - [12] " add_recipe(test_config_55_no_dummies_recipe) %>% " - [13] " add_model(test_config_55_no_dummies_spec) " - [14] "" - [15] "set.seed(27246)" - [16] "test_config_55_no_dummies_tune <-" - [17] " tune_grid(test_config_55_no_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [18] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_56_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [3] " step_zv(all_predictors()) %>% " - [4] " step_normalize(all_numeric_predictors()) " - [5] "" - [6] "test_config_56_dummies_spec <- " - [7] " svm_rbf(cost = tune(), rbf_sigma = tune()) %>% " - [8] " set_mode(\"regression\") " - [9] "" - [10] "test_config_56_dummies_workflow <- " - [11] " workflow() %>% " - [12] " add_recipe(test_config_56_dummies_recipe) %>% " - [13] " add_model(test_config_56_dummies_spec) " - [14] "" - [15] "set.seed(27246)" - [16] "test_config_56_dummies_tune <-" - [17] " tune_grid(test_config_56_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [18] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_56_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) %>% " - [3] " step_zv(all_predictors()) %>% " - [4] " step_normalize(all_numeric_predictors()) " - [5] "" - [6] "test_config_56_no_dummies_spec <- " - [7] " svm_rbf(cost = tune(), rbf_sigma = tune()) %>% " - [8] " set_mode(\"classification\") " - [9] "" - [10] "test_config_56_no_dummies_workflow <- " - [11] " workflow() %>% " - [12] " add_recipe(test_config_56_no_dummies_recipe) %>% " - [13] " add_model(test_config_56_no_dummies_spec) " - [14] "" - [15] "set.seed(27246)" - [16] "test_config_56_no_dummies_tune <-" - [17] " tune_grid(test_config_56_no_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [18] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_57_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " step_dummy(all_nominal_predictors()) %>% " - [5] " step_zv(all_predictors()) %>% " - [6] " step_normalize(all_numeric_predictors()) " - [7] "" - [8] "test_config_57_dummies_spec <- " - [9] " nearest_neighbor(neighbors = tune(), weight_func = tune()) %>% " - [10] " set_mode(\"regression\") %>% " - [11] " set_engine(\"kknn\") " - [12] "" - [13] "test_config_57_dummies_workflow <- " - [14] " workflow() %>% " - [15] " add_recipe(test_config_57_dummies_recipe) %>% " - [16] " add_model(test_config_57_dummies_spec) " - [17] "" - [18] "set.seed(27246)" - [19] "test_config_57_dummies_tune <-" - [20] " tune_grid(test_config_57_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [21] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_57_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " step_dummy(all_nominal_predictors()) %>% " - [5] " step_zv(all_predictors()) %>% " - [6] " step_normalize(all_numeric_predictors()) " - [7] "" - [8] "test_config_57_no_dummies_spec <- " - [9] " nearest_neighbor(neighbors = tune(), weight_func = tune()) %>% " - [10] " set_mode(\"classification\") %>% " - [11] " set_engine(\"kknn\") " - [12] "" - [13] "test_config_57_no_dummies_workflow <- " - [14] " workflow() %>% " - [15] " add_recipe(test_config_57_no_dummies_recipe) %>% " - [16] " add_model(test_config_57_no_dummies_spec) " - [17] "" - [18] "set.seed(27246)" - [19] "test_config_57_no_dummies_tune <-" - [20] " tune_grid(test_config_57_no_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [21] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_58_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) " - [3] "" - [4] "test_config_58_dummies_spec <- " - [5] " gen_additive_mod(select_features = tune(), adjust_deg_free = tune()) %>% " - [6] " set_mode(\"regression\") %>% " - [7] " set_engine(\"mgcv\") " - [8] "" - [9] "test_config_58_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_58_dummies_recipe) %>% " - [12] " add_model(test_config_58_dummies_spec, formula = stop(\"add your gam formula\")) " - [13] "" - [14] "set.seed(27246)" - [15] "test_config_58_dummies_tune <-" - [16] " tune_grid(test_config_58_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [17] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_58_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) " - [3] "" - [4] "test_config_58_no_dummies_spec <- " - [5] " gen_additive_mod(select_features = tune(), adjust_deg_free = tune()) %>% " - [6] " set_mode(\"classification\") %>% " - [7] " set_engine(\"mgcv\") " - [8] "" - [9] "test_config_58_no_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_58_no_dummies_recipe) %>% " - [12] " add_model(test_config_58_no_dummies_spec, formula = stop(\"add your gam formula\")) " - [13] "" - [14] "set.seed(27246)" - [15] "test_config_58_no_dummies_tune <-" - [16] " tune_grid(test_config_58_no_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [17] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "library(plsmod)" - [2] "" - [3] "test_config_59_dummies_recipe <- " - [4] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [5] " step_novel(all_nominal_predictors()) %>% " - [6] " step_dummy(all_nominal_predictors()) %>% " - [7] " step_zv(all_predictors()) %>% " - [8] " step_normalize(all_numeric_predictors()) " - [9] "" - [10] "test_config_59_dummies_spec <- " - [11] " pls(predictor_prop = tune(), num_comp = tune()) %>% " - [12] " set_mode(\"regression\") %>% " - [13] " set_engine(\"mixOmics\") " - [14] "" - [15] "test_config_59_dummies_workflow <- " - [16] " workflow() %>% " - [17] " add_recipe(test_config_59_dummies_recipe) %>% " - [18] " add_model(test_config_59_dummies_spec) " - [19] "" - [20] "set.seed(27246)" - [21] "test_config_59_dummies_tune <-" - [22] " tune_grid(test_config_59_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [23] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "library(plsmod)" - [2] "" - [3] "test_config_59_no_dummies_recipe <- " - [4] " recipe(formula = species ~ ., data = penguins) %>% " - [5] " step_novel(all_nominal_predictors()) %>% " - [6] " step_dummy(all_nominal_predictors()) %>% " - [7] " step_zv(all_predictors()) %>% " - [8] " step_normalize(all_numeric_predictors()) " - [9] "" - [10] "test_config_59_no_dummies_spec <- " - [11] " pls(predictor_prop = tune(), num_comp = tune()) %>% " - [12] " set_mode(\"classification\") %>% " - [13] " set_engine(\"mixOmics\") " - [14] "" - [15] "test_config_59_no_dummies_workflow <- " - [16] " workflow() %>% " - [17] " add_recipe(test_config_59_no_dummies_recipe) %>% " - [18] " add_model(test_config_59_no_dummies_spec) " - [19] "" - [20] "set.seed(27246)" - [21] "test_config_59_no_dummies_tune <-" - [22] " tune_grid(test_config_59_no_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [23] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_60_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " step_dummy(all_nominal_predictors()) %>% " - [5] " step_zv(all_predictors()) %>% " - [6] " step_normalize(all_numeric_predictors()) " - [7] "" - [8] "test_config_60_dummies_spec <- " - [9] " mlp(hidden_units = tune(), penalty = tune(), epochs = tune()) %>% " - [10] " set_mode(\"regression\") " - [11] "" - [12] "test_config_60_dummies_workflow <- " - [13] " workflow() %>% " - [14] " add_recipe(test_config_60_dummies_recipe) %>% " - [15] " add_model(test_config_60_dummies_spec) " - [16] "" - [17] "set.seed(27246)" - [18] "test_config_60_dummies_tune <-" - [19] " tune_grid(test_config_60_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [20] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_60_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " step_dummy(all_nominal_predictors()) %>% " - [5] " step_zv(all_predictors()) %>% " - [6] " step_normalize(all_numeric_predictors()) " - [7] "" - [8] "test_config_60_no_dummies_spec <- " - [9] " mlp(hidden_units = tune(), penalty = tune(), epochs = tune()) %>% " - [10] " set_mode(\"classification\") " - [11] "" - [12] "test_config_60_no_dummies_workflow <- " - [13] " workflow() %>% " - [14] " add_recipe(test_config_60_no_dummies_recipe) %>% " - [15] " add_model(test_config_60_no_dummies_spec) " - [16] "" - [17] "set.seed(27246)" - [18] "test_config_60_no_dummies_tune <-" - [19] " tune_grid(test_config_60_no_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [20] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_61_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) " - [3] "" - [4] "test_config_61_dummies_spec <- " - [5] " rand_forest(mtry = tune(), min_n = tune(), trees = 1000) %>% " - [6] " set_mode(\"regression\") %>% " - [7] " set_engine(\"ranger\") " - [8] "" - [9] "test_config_61_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_61_dummies_recipe) %>% " - [12] " add_model(test_config_61_dummies_spec) " - [13] "" - [14] "set.seed(27246)" - [15] "test_config_61_dummies_tune <-" - [16] " tune_grid(test_config_61_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [17] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_61_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) " - [3] "" - [4] "test_config_61_no_dummies_spec <- " - [5] " rand_forest(mtry = tune(), min_n = tune(), trees = 1000) %>% " - [6] " set_mode(\"classification\") %>% " - [7] " set_engine(\"ranger\") " - [8] "" - [9] "test_config_61_no_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_61_no_dummies_recipe) %>% " - [12] " add_model(test_config_61_no_dummies_spec) " - [13] "" - [14] "set.seed(27246)" - [15] "test_config_61_no_dummies_tune <-" - [16] " tune_grid(test_config_61_no_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [17] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_62_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) " - [3] "" - [4] "test_config_62_dummies_spec <- " - [5] " decision_tree(tree_depth = tune(), min_n = tune(), cost_complexity = tune()) %>% " - [6] " set_mode(\"regression\") %>% " - [7] " set_engine(\"rpart\") " - [8] "" - [9] "test_config_62_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_62_dummies_recipe) %>% " - [12] " add_model(test_config_62_dummies_spec) " - [13] "" - [14] "set.seed(27246)" - [15] "test_config_62_dummies_tune <-" - [16] " tune_grid(test_config_62_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [17] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_62_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) " - [3] "" - [4] "test_config_62_no_dummies_spec <- " - [5] " decision_tree(tree_depth = tune(), min_n = tune(), cost_complexity = tune()) %>% " - [6] " set_mode(\"classification\") %>% " - [7] " set_engine(\"rpart\") " - [8] "" - [9] "test_config_62_no_dummies_workflow <- " - [10] " workflow() %>% " - [11] " add_recipe(test_config_62_no_dummies_recipe) %>% " - [12] " add_model(test_config_62_no_dummies_spec) " - [13] "" - [14] "set.seed(27246)" - [15] "test_config_62_no_dummies_tune <-" - [16] " tune_grid(test_config_62_no_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [17] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_63_dummies_recipe <- " - [2] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " step_dummy(all_nominal_predictors(), one_hot = TRUE) %>% " - [5] " step_zv(all_predictors()) " - [6] "" - [7] "test_config_63_dummies_spec <- " - [8] " boost_tree(trees = tune(), min_n = tune(), tree_depth = tune(), learn_rate = tune(), " - [9] " loss_reduction = tune(), sample_size = tune()) %>% " - [10] " set_mode(\"regression\") %>% " - [11] " set_engine(\"xgboost\") " - [12] "" - [13] "test_config_63_dummies_workflow <- " - [14] " workflow() %>% " - [15] " add_recipe(test_config_63_dummies_recipe) %>% " - [16] " add_model(test_config_63_dummies_spec) " - [17] "" - [18] "set.seed(27246)" - [19] "test_config_63_dummies_tune <-" - [20] " tune_grid(test_config_63_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [21] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "test_config_63_no_dummies_recipe <- " - [2] " recipe(formula = species ~ ., data = penguins) %>% " - [3] " step_novel(all_nominal_predictors()) %>% " - [4] " step_dummy(all_nominal_predictors(), one_hot = TRUE) %>% " - [5] " step_zv(all_predictors()) " - [6] "" - [7] "test_config_63_no_dummies_spec <- " - [8] " boost_tree(trees = tune(), min_n = tune(), tree_depth = tune(), learn_rate = tune(), " - [9] " loss_reduction = tune(), sample_size = tune()) %>% " - [10] " set_mode(\"classification\") %>% " - [11] " set_engine(\"xgboost\") " - [12] "" - [13] "test_config_63_no_dummies_workflow <- " - [14] " workflow() %>% " - [15] " add_recipe(test_config_63_no_dummies_recipe) %>% " - [16] " add_model(test_config_63_no_dummies_spec) " - [17] "" - [18] "set.seed(27246)" - [19] "test_config_63_no_dummies_tune <-" - [20] " tune_grid(test_config_63_no_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [21] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "library(rules)" - [2] "" - [3] "test_config_64_dummies_recipe <- " - [4] " recipe(formula = body_mass_g ~ ., data = penguins) %>% " - [5] " step_novel(all_nominal_predictors()) %>% " - [6] " step_dummy(all_nominal_predictors()) %>% " - [7] " step_zv(all_predictors()) %>% " - [8] " step_normalize(all_numeric_predictors()) " - [9] "" - [10] "test_config_64_dummies_spec <- " - [11] " rule_fit(mtry = tune(), trees = tune(), min_n = tune(), tree_depth = tune(), " - [12] " learn_rate = tune(), loss_reduction = tune(), sample_size = tune(), penalty = tune()) %>% " - [13] " set_mode(\"regression\") %>% " - [14] " set_engine(\"xrf\") " - [15] "" - [16] "test_config_64_dummies_workflow <- " - [17] " workflow() %>% " - [18] " add_recipe(test_config_64_dummies_recipe) %>% " - [19] " add_model(test_config_64_dummies_spec) " - [20] "" - [21] "set.seed(27246)" - [22] "test_config_64_dummies_tune <-" - [23] " tune_grid(test_config_64_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [24] " grid = stop(\"add number of candidate points\"))" - ---- - - Code - no_dummy_clip_template(model, prefix, verbose, tune) - Message - v code is on the clipboard. - Output - [1] "library(rules)" - [2] "" - [3] "test_config_64_no_dummies_recipe <- " - [4] " recipe(formula = species ~ ., data = penguins) %>% " - [5] " step_novel(all_nominal_predictors()) %>% " - [6] " step_dummy(all_nominal_predictors()) %>% " - [7] " step_zv(all_predictors()) %>% " - [8] " step_normalize(all_numeric_predictors()) " - [9] "" - [10] "test_config_64_no_dummies_spec <- " - [11] " rule_fit(mtry = tune(), trees = tune(), min_n = tune(), tree_depth = tune(), " - [12] " learn_rate = tune(), loss_reduction = tune(), sample_size = tune(), penalty = tune()) %>% " - [13] " set_mode(\"classification\") %>% " - [14] " set_engine(\"xrf\") " - [15] "" - [16] "test_config_64_no_dummies_workflow <- " - [17] " workflow() %>% " - [18] " add_recipe(test_config_64_no_dummies_recipe) %>% " - [19] " add_model(test_config_64_no_dummies_spec) " - [20] "" - [21] "set.seed(27246)" - [22] "test_config_64_no_dummies_tune <-" - [23] " tune_grid(test_config_64_no_dummies_workflow, resamples = stop(\"add your rsample object\"), " - [24] " grid = stop(\"add number of candidate points\"))" - diff --git a/tests/testthat/_snaps/templates.md b/tests/testthat/_snaps/templates.md index abd555d..1c859ff 100644 --- a/tests/testthat/_snaps/templates.md +++ b/tests/testthat/_snaps/templates.md @@ -9,13 +9,13 @@ recipe(formula = body_mass_g ~ ., data = penguins) test_config_1_dummies_spec <- - bag_tree() %>% - set_mode("regression") %>% + bag_tree() |> + set_mode("regression") |> set_engine("rpart") test_config_1_dummies_workflow <- - workflow() %>% - add_recipe(test_config_1_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_1_dummies_recipe) |> add_model(test_config_1_dummies_spec) @@ -30,13 +30,13 @@ recipe(formula = species ~ ., data = penguins) test_config_1_no_dummies_spec <- - bag_tree() %>% - set_mode("classification") %>% + bag_tree() |> + set_mode("classification") |> set_engine("rpart") test_config_1_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_1_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_1_no_dummies_recipe) |> add_model(test_config_1_no_dummies_spec) @@ -49,13 +49,13 @@ recipe(formula = species ~ ., data = penguins) test_config_2_no_dummies_spec <- - boost_tree() %>% - set_mode("classification") %>% + boost_tree() |> + set_mode("classification") |> set_engine("C5.0") test_config_2_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_2_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_2_no_dummies_recipe) |> add_model(test_config_2_no_dummies_spec) @@ -67,16 +67,16 @@ library(rules) test_config_3_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> step_zv(all_predictors()) test_config_3_dummies_spec <- - cubist_rules() %>% + cubist_rules() |> set_engine("Cubist") test_config_3_dummies_workflow <- - workflow() %>% - add_recipe(test_config_3_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_3_dummies_recipe) |> add_model(test_config_3_dummies_spec) @@ -89,13 +89,13 @@ recipe(formula = body_mass_g ~ ., data = penguins) test_config_4_dummies_spec <- - bart() %>% - set_mode("regression") %>% + bart() |> + set_mode("regression") |> set_engine("dbarts") test_config_4_dummies_workflow <- - workflow() %>% - add_recipe(test_config_4_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_4_dummies_recipe) |> add_model(test_config_4_dummies_spec) @@ -108,13 +108,13 @@ recipe(formula = species ~ ., data = penguins) test_config_4_no_dummies_spec <- - bart() %>% - set_mode("classification") %>% + bart() |> + set_mode("classification") |> set_engine("dbarts") test_config_4_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_4_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_4_no_dummies_recipe) |> add_model(test_config_4_no_dummies_spec) @@ -124,23 +124,23 @@ dummy_template(model, prefix, verbose, tune) Output test_config_5_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> ## This model requires the predictors to be numeric. The most common ## method to convert qualitative predictors to numeric is to create ## binary indicator variables (aka dummy variables) from these ## predictors. - step_dummy(all_nominal_predictors()) %>% + step_dummy(all_nominal_predictors()) |> step_zv(all_predictors()) test_config_5_dummies_spec <- - mars() %>% - set_mode("regression") %>% + mars() |> + set_mode("regression") |> set_engine("earth") test_config_5_dummies_workflow <- - workflow() %>% - add_recipe(test_config_5_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_5_dummies_recipe) |> add_model(test_config_5_dummies_spec) @@ -150,23 +150,23 @@ no_dummy_template(model, prefix, verbose, tune) Output test_config_5_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% + recipe(formula = species ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> ## This model requires the predictors to be numeric. The most common ## method to convert qualitative predictors to numeric is to create ## binary indicator variables (aka dummy variables) from these ## predictors. - step_dummy(all_nominal_predictors()) %>% + step_dummy(all_nominal_predictors()) |> step_zv(all_predictors()) test_config_5_no_dummies_spec <- - mars() %>% - set_mode("classification") %>% + mars() |> + set_mode("classification") |> set_engine("earth") test_config_5_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_5_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_5_no_dummies_recipe) |> add_model(test_config_5_no_dummies_spec) @@ -176,28 +176,28 @@ dummy_template(model, prefix, verbose, tune) Output test_config_6_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> ## This model requires the predictors to be numeric. The most common ## method to convert qualitative predictors to numeric is to create ## binary indicator variables (aka dummy variables) from these ## predictors. - step_dummy(all_nominal_predictors()) %>% + step_dummy(all_nominal_predictors()) |> ## Regularization methods sum up functions of the model slope ## coefficients. Because of this, the predictor variables should be on ## the same scale. Before centering and scaling the numeric predictors, ## any predictors with a single unique value are filtered out. - step_zv(all_predictors()) %>% + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_6_dummies_spec <- - linear_reg() %>% - set_mode("regression") %>% + linear_reg() |> + set_mode("regression") |> set_engine("glmnet") test_config_6_dummies_workflow <- - workflow() %>% - add_recipe(test_config_6_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_6_dummies_recipe) |> add_model(test_config_6_dummies_spec) @@ -207,28 +207,28 @@ no_dummy_template(model, prefix, verbose, tune) Output test_config_6_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% + recipe(formula = species ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> ## This model requires the predictors to be numeric. The most common ## method to convert qualitative predictors to numeric is to create ## binary indicator variables (aka dummy variables) from these ## predictors. - step_dummy(all_nominal_predictors()) %>% + step_dummy(all_nominal_predictors()) |> ## Regularization methods sum up functions of the model slope ## coefficients. Because of this, the predictor variables should be on ## the same scale. Before centering and scaling the numeric predictors, ## any predictors with a single unique value are filtered out. - step_zv(all_predictors()) %>% + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_6_no_dummies_spec <- - multinom_reg() %>% - set_mode("classification") %>% + multinom_reg() |> + set_mode("classification") |> set_engine("glmnet") test_config_6_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_6_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_6_no_dummies_recipe) |> add_model(test_config_6_no_dummies_spec) @@ -238,21 +238,21 @@ dummy_template(model, prefix, verbose, tune) Output test_config_7_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> ## Since dot product calculations are used, the predictor variables ## should be on the same scale. Before centering and scaling the numeric ## predictors, any predictors with a single unique value are filtered ## out. - step_zv(all_predictors()) %>% + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_7_dummies_spec <- - svm_poly() %>% + svm_poly() |> set_mode("regression") test_config_7_dummies_workflow <- - workflow() %>% - add_recipe(test_config_7_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_7_dummies_recipe) |> add_model(test_config_7_dummies_spec) @@ -262,21 +262,21 @@ no_dummy_template(model, prefix, verbose, tune) Output test_config_7_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% + recipe(formula = species ~ ., data = penguins) |> ## Since dot product calculations are used, the predictor variables ## should be on the same scale. Before centering and scaling the numeric ## predictors, any predictors with a single unique value are filtered ## out. - step_zv(all_predictors()) %>% + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_7_no_dummies_spec <- - svm_poly() %>% + svm_poly() |> set_mode("classification") test_config_7_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_7_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_7_no_dummies_recipe) |> add_model(test_config_7_no_dummies_spec) @@ -286,21 +286,21 @@ dummy_template(model, prefix, verbose, tune) Output test_config_8_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> ## Since dot product calculations are used, the predictor variables ## should be on the same scale. Before centering and scaling the numeric ## predictors, any predictors with a single unique value are filtered ## out. - step_zv(all_predictors()) %>% + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_8_dummies_spec <- - svm_rbf() %>% + svm_rbf() |> set_mode("regression") test_config_8_dummies_workflow <- - workflow() %>% - add_recipe(test_config_8_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_8_dummies_recipe) |> add_model(test_config_8_dummies_spec) @@ -310,21 +310,21 @@ no_dummy_template(model, prefix, verbose, tune) Output test_config_8_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% + recipe(formula = species ~ ., data = penguins) |> ## Since dot product calculations are used, the predictor variables ## should be on the same scale. Before centering and scaling the numeric ## predictors, any predictors with a single unique value are filtered ## out. - step_zv(all_predictors()) %>% + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_8_no_dummies_spec <- - svm_rbf() %>% + svm_rbf() |> set_mode("classification") test_config_8_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_8_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_8_no_dummies_recipe) |> add_model(test_config_8_no_dummies_spec) @@ -334,28 +334,28 @@ dummy_template(model, prefix, verbose, tune) Output test_config_9_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> ## This model requires the predictors to be numeric. The most common ## method to convert qualitative predictors to numeric is to create ## binary indicator variables (aka dummy variables) from these ## predictors. - step_dummy(all_nominal_predictors()) %>% + step_dummy(all_nominal_predictors()) |> ## Since distance calculations are used, the predictor variables should ## be on the same scale. Before centering and scaling the numeric ## predictors, any predictors with a single unique value are filtered ## out. - step_zv(all_predictors()) %>% + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_9_dummies_spec <- - nearest_neighbor() %>% - set_mode("regression") %>% + nearest_neighbor() |> + set_mode("regression") |> set_engine("kknn") test_config_9_dummies_workflow <- - workflow() %>% - add_recipe(test_config_9_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_9_dummies_recipe) |> add_model(test_config_9_dummies_spec) @@ -365,28 +365,28 @@ no_dummy_template(model, prefix, verbose, tune) Output test_config_9_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% + recipe(formula = species ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> ## This model requires the predictors to be numeric. The most common ## method to convert qualitative predictors to numeric is to create ## binary indicator variables (aka dummy variables) from these ## predictors. - step_dummy(all_nominal_predictors()) %>% + step_dummy(all_nominal_predictors()) |> ## Since distance calculations are used, the predictor variables should ## be on the same scale. Before centering and scaling the numeric ## predictors, any predictors with a single unique value are filtered ## out. - step_zv(all_predictors()) %>% + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_9_no_dummies_spec <- - nearest_neighbor() %>% - set_mode("classification") %>% + nearest_neighbor() |> + set_mode("classification") |> set_engine("kknn") test_config_9_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_9_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_9_no_dummies_recipe) |> add_model(test_config_9_no_dummies_spec) @@ -399,13 +399,13 @@ recipe(formula = body_mass_g ~ ., data = penguins) test_config_10_dummies_spec <- - gen_additive_mod() %>% - set_mode("regression") %>% + gen_additive_mod() |> + set_mode("regression") |> set_engine("mgcv") test_config_10_dummies_workflow <- - workflow() %>% - add_recipe(test_config_10_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_10_dummies_recipe) |> add_model(test_config_10_dummies_spec, formula = stop("add your gam formula")) @@ -418,13 +418,13 @@ recipe(formula = species ~ ., data = penguins) test_config_10_no_dummies_spec <- - gen_additive_mod() %>% - set_mode("classification") %>% + gen_additive_mod() |> + set_mode("classification") |> set_engine("mgcv") test_config_10_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_10_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_10_no_dummies_recipe) |> add_model(test_config_10_no_dummies_spec, formula = stop("add your gam formula")) @@ -436,24 +436,24 @@ library(plsmod) test_config_11_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> ## This model requires the predictors to be numeric. The most common ## method to convert qualitative predictors to numeric is to create ## binary indicator variables (aka dummy variables) from these ## predictors. - step_dummy(all_nominal_predictors()) %>% - step_zv(all_predictors()) %>% + step_dummy(all_nominal_predictors()) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_11_dummies_spec <- - pls() %>% - set_mode("regression") %>% + pls() |> + set_mode("regression") |> set_engine("mixOmics") test_config_11_dummies_workflow <- - workflow() %>% - add_recipe(test_config_11_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_11_dummies_recipe) |> add_model(test_config_11_dummies_spec) @@ -465,24 +465,24 @@ library(plsmod) test_config_11_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% + recipe(formula = species ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> ## This model requires the predictors to be numeric. The most common ## method to convert qualitative predictors to numeric is to create ## binary indicator variables (aka dummy variables) from these ## predictors. - step_dummy(all_nominal_predictors()) %>% - step_zv(all_predictors()) %>% + step_dummy(all_nominal_predictors()) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_11_no_dummies_spec <- - pls() %>% - set_mode("classification") %>% + pls() |> + set_mode("classification") |> set_engine("mixOmics") test_config_11_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_11_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_11_no_dummies_recipe) |> add_model(test_config_11_no_dummies_spec) @@ -492,23 +492,23 @@ dummy_template(model, prefix, verbose, tune) Output test_config_12_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> ## This model requires the predictors to be numeric. The most common ## method to convert qualitative predictors to numeric is to create ## binary indicator variables (aka dummy variables) from these ## predictors. - step_dummy(all_nominal_predictors()) %>% - step_zv(all_predictors()) %>% + step_dummy(all_nominal_predictors()) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_12_dummies_spec <- - mlp() %>% + mlp() |> set_mode("regression") test_config_12_dummies_workflow <- - workflow() %>% - add_recipe(test_config_12_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_12_dummies_recipe) |> add_model(test_config_12_dummies_spec) @@ -518,23 +518,23 @@ no_dummy_template(model, prefix, verbose, tune) Output test_config_12_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% + recipe(formula = species ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> ## This model requires the predictors to be numeric. The most common ## method to convert qualitative predictors to numeric is to create ## binary indicator variables (aka dummy variables) from these ## predictors. - step_dummy(all_nominal_predictors()) %>% - step_zv(all_predictors()) %>% + step_dummy(all_nominal_predictors()) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_12_no_dummies_spec <- - mlp() %>% + mlp() |> set_mode("classification") test_config_12_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_12_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_12_no_dummies_recipe) |> add_model(test_config_12_no_dummies_spec) @@ -547,13 +547,13 @@ recipe(formula = body_mass_g ~ ., data = penguins) test_config_13_dummies_spec <- - rand_forest(trees = 1000) %>% - set_mode("regression") %>% + rand_forest(trees = 1000) |> + set_mode("regression") |> set_engine("ranger") test_config_13_dummies_workflow <- - workflow() %>% - add_recipe(test_config_13_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_13_dummies_recipe) |> add_model(test_config_13_dummies_spec) @@ -566,13 +566,13 @@ recipe(formula = species ~ ., data = penguins) test_config_13_no_dummies_spec <- - rand_forest(trees = 1000) %>% - set_mode("classification") %>% + rand_forest(trees = 1000) |> + set_mode("classification") |> set_engine("ranger") test_config_13_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_13_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_13_no_dummies_recipe) |> add_model(test_config_13_no_dummies_spec) @@ -585,13 +585,13 @@ recipe(formula = body_mass_g ~ ., data = penguins) test_config_14_dummies_spec <- - decision_tree() %>% - set_mode("regression") %>% + decision_tree() |> + set_mode("regression") |> set_engine("rpart") test_config_14_dummies_workflow <- - workflow() %>% - add_recipe(test_config_14_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_14_dummies_recipe) |> add_model(test_config_14_dummies_spec) @@ -604,13 +604,13 @@ recipe(formula = species ~ ., data = penguins) test_config_14_no_dummies_spec <- - decision_tree() %>% - set_mode("classification") %>% + decision_tree() |> + set_mode("classification") |> set_engine("rpart") test_config_14_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_14_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_14_no_dummies_recipe) |> add_model(test_config_14_no_dummies_spec) @@ -620,25 +620,25 @@ dummy_template(model, prefix, verbose, tune) Output test_config_15_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> ## This model requires the predictors to be numeric. The most common ## method to convert qualitative predictors to numeric is to create ## binary indicator variables (aka dummy variables) from these ## predictors. However, for this model, binary indicator variables can be ## made for each of the levels of the factors (known as 'one-hot ## encoding'). - step_dummy(all_nominal_predictors(), one_hot = TRUE) %>% + step_dummy(all_nominal_predictors(), one_hot = TRUE) |> step_zv(all_predictors()) test_config_15_dummies_spec <- - boost_tree() %>% - set_mode("regression") %>% + boost_tree() |> + set_mode("regression") |> set_engine("xgboost") test_config_15_dummies_workflow <- - workflow() %>% - add_recipe(test_config_15_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_15_dummies_recipe) |> add_model(test_config_15_dummies_spec) @@ -648,25 +648,25 @@ no_dummy_template(model, prefix, verbose, tune) Output test_config_15_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% + recipe(formula = species ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> ## This model requires the predictors to be numeric. The most common ## method to convert qualitative predictors to numeric is to create ## binary indicator variables (aka dummy variables) from these ## predictors. However, for this model, binary indicator variables can be ## made for each of the levels of the factors (known as 'one-hot ## encoding'). - step_dummy(all_nominal_predictors(), one_hot = TRUE) %>% + step_dummy(all_nominal_predictors(), one_hot = TRUE) |> step_zv(all_predictors()) test_config_15_no_dummies_spec <- - boost_tree() %>% - set_mode("classification") %>% + boost_tree() |> + set_mode("classification") |> set_engine("xgboost") test_config_15_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_15_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_15_no_dummies_recipe) |> add_model(test_config_15_no_dummies_spec) @@ -678,24 +678,24 @@ library(rules) test_config_16_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> ## This model requires the predictors to be numeric. The most common ## method to convert qualitative predictors to numeric is to create ## binary indicator variables (aka dummy variables) from these ## predictors. - step_dummy(all_nominal_predictors()) %>% - step_zv(all_predictors()) %>% + step_dummy(all_nominal_predictors()) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_16_dummies_spec <- - rule_fit() %>% - set_mode("regression") %>% + rule_fit() |> + set_mode("regression") |> set_engine("xrf") test_config_16_dummies_workflow <- - workflow() %>% - add_recipe(test_config_16_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_16_dummies_recipe) |> add_model(test_config_16_dummies_spec) @@ -707,24 +707,24 @@ library(rules) test_config_16_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% + recipe(formula = species ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> ## This model requires the predictors to be numeric. The most common ## method to convert qualitative predictors to numeric is to create ## binary indicator variables (aka dummy variables) from these ## predictors. - step_dummy(all_nominal_predictors()) %>% - step_zv(all_predictors()) %>% + step_dummy(all_nominal_predictors()) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_16_no_dummies_spec <- - rule_fit() %>% - set_mode("classification") %>% + rule_fit() |> + set_mode("classification") |> set_engine("xrf") test_config_16_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_16_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_16_no_dummies_recipe) |> add_model(test_config_16_no_dummies_spec) @@ -739,13 +739,13 @@ recipe(formula = body_mass_g ~ ., data = penguins) test_config_17_dummies_spec <- - bag_tree(tree_depth = tune(), min_n = tune(), cost_complexity = tune()) %>% - set_mode("regression") %>% + bag_tree(tree_depth = tune(), min_n = tune(), cost_complexity = tune()) |> + set_mode("regression") |> set_engine("rpart") test_config_17_dummies_workflow <- - workflow() %>% - add_recipe(test_config_17_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_17_dummies_recipe) |> add_model(test_config_17_dummies_spec) set.seed(27246) @@ -765,13 +765,13 @@ recipe(formula = species ~ ., data = penguins) test_config_17_no_dummies_spec <- - bag_tree(tree_depth = tune(), min_n = tune(), cost_complexity = tune()) %>% - set_mode("classification") %>% + bag_tree(tree_depth = tune(), min_n = tune(), cost_complexity = tune()) |> + set_mode("classification") |> set_engine("rpart") test_config_17_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_17_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_17_no_dummies_recipe) |> add_model(test_config_17_no_dummies_spec) set.seed(27246) @@ -789,13 +789,13 @@ recipe(formula = species ~ ., data = penguins) test_config_18_no_dummies_spec <- - boost_tree(trees = tune(), min_n = tune()) %>% - set_mode("classification") %>% + boost_tree(trees = tune(), min_n = tune()) |> + set_mode("classification") |> set_engine("C5.0") test_config_18_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_18_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_18_no_dummies_recipe) |> add_model(test_config_18_no_dummies_spec) set.seed(27246) @@ -812,16 +812,16 @@ library(rules) test_config_19_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> step_zv(all_predictors()) test_config_19_dummies_spec <- - cubist_rules(committees = tune(), neighbors = tune()) %>% + cubist_rules(committees = tune(), neighbors = tune()) |> set_engine("Cubist") test_config_19_dummies_workflow <- - workflow() %>% - add_recipe(test_config_19_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_19_dummies_recipe) |> add_model(test_config_19_dummies_spec) test_config_19_dummies_grid <- tidyr::crossing(committees = c(1:9, (1:5) * @@ -841,13 +841,13 @@ recipe(formula = body_mass_g ~ ., data = penguins) test_config_20_dummies_spec <- - bart(trees = tune(), prior_terminal_node_coef = tune(), prior_terminal_node_expo = tune()) %>% - set_mode("regression") %>% + bart(trees = tune(), prior_terminal_node_coef = tune(), prior_terminal_node_expo = tune()) |> + set_mode("regression") |> set_engine("dbarts") test_config_20_dummies_workflow <- - workflow() %>% - add_recipe(test_config_20_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_20_dummies_recipe) |> add_model(test_config_20_dummies_spec) set.seed(27246) @@ -865,13 +865,13 @@ recipe(formula = species ~ ., data = penguins) test_config_20_no_dummies_spec <- - bart(trees = tune(), prior_terminal_node_coef = tune(), prior_terminal_node_expo = tune()) %>% - set_mode("classification") %>% + bart(trees = tune(), prior_terminal_node_coef = tune(), prior_terminal_node_expo = tune()) |> + set_mode("classification") |> set_engine("dbarts") test_config_20_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_20_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_20_no_dummies_recipe) |> add_model(test_config_20_no_dummies_spec) set.seed(27246) @@ -886,23 +886,23 @@ dummy_template(model, prefix, verbose, tune) Output test_config_21_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> ## This model requires the predictors to be numeric. The most common ## method to convert qualitative predictors to numeric is to create ## binary indicator variables (aka dummy variables) from these ## predictors. - step_dummy(all_nominal_predictors()) %>% + step_dummy(all_nominal_predictors()) |> step_zv(all_predictors()) test_config_21_dummies_spec <- - mars(num_terms = tune(), prod_degree = tune(), prune_method = "none") %>% - set_mode("regression") %>% + mars(num_terms = tune(), prod_degree = tune(), prune_method = "none") |> + set_mode("regression") |> set_engine("earth") test_config_21_dummies_workflow <- - workflow() %>% - add_recipe(test_config_21_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_21_dummies_recipe) |> add_model(test_config_21_dummies_spec) ## MARS models can make predictions on many _sub_models_, meaning that we @@ -923,23 +923,23 @@ no_dummy_template(model, prefix, verbose, tune) Output test_config_21_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% + recipe(formula = species ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> ## This model requires the predictors to be numeric. The most common ## method to convert qualitative predictors to numeric is to create ## binary indicator variables (aka dummy variables) from these ## predictors. - step_dummy(all_nominal_predictors()) %>% + step_dummy(all_nominal_predictors()) |> step_zv(all_predictors()) test_config_21_no_dummies_spec <- - mars(num_terms = tune(), prod_degree = tune(), prune_method = "none") %>% - set_mode("classification") %>% + mars(num_terms = tune(), prod_degree = tune(), prune_method = "none") |> + set_mode("classification") |> set_engine("earth") test_config_21_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_21_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_21_no_dummies_recipe) |> add_model(test_config_21_no_dummies_spec) ## MARS models can make predictions on many _sub_models_, meaning that we @@ -960,28 +960,28 @@ dummy_template(model, prefix, verbose, tune) Output test_config_22_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> ## This model requires the predictors to be numeric. The most common ## method to convert qualitative predictors to numeric is to create ## binary indicator variables (aka dummy variables) from these ## predictors. - step_dummy(all_nominal_predictors()) %>% + step_dummy(all_nominal_predictors()) |> ## Regularization methods sum up functions of the model slope ## coefficients. Because of this, the predictor variables should be on ## the same scale. Before centering and scaling the numeric predictors, ## any predictors with a single unique value are filtered out. - step_zv(all_predictors()) %>% + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_22_dummies_spec <- - linear_reg(penalty = tune(), mixture = tune()) %>% - set_mode("regression") %>% + linear_reg(penalty = tune(), mixture = tune()) |> + set_mode("regression") |> set_engine("glmnet") test_config_22_dummies_workflow <- - workflow() %>% - add_recipe(test_config_22_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_22_dummies_recipe) |> add_model(test_config_22_dummies_spec) test_config_22_dummies_grid <- tidyr::crossing(penalty = 10^seq(-6, -1, length.out = 20), @@ -998,28 +998,28 @@ no_dummy_template(model, prefix, verbose, tune) Output test_config_22_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% + recipe(formula = species ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> ## This model requires the predictors to be numeric. The most common ## method to convert qualitative predictors to numeric is to create ## binary indicator variables (aka dummy variables) from these ## predictors. - step_dummy(all_nominal_predictors()) %>% + step_dummy(all_nominal_predictors()) |> ## Regularization methods sum up functions of the model slope ## coefficients. Because of this, the predictor variables should be on ## the same scale. Before centering and scaling the numeric predictors, ## any predictors with a single unique value are filtered out. - step_zv(all_predictors()) %>% + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_22_no_dummies_spec <- - multinom_reg(penalty = tune(), mixture = tune()) %>% - set_mode("classification") %>% + multinom_reg(penalty = tune(), mixture = tune()) |> + set_mode("classification") |> set_engine("glmnet") test_config_22_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_22_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_22_no_dummies_recipe) |> add_model(test_config_22_no_dummies_spec) test_config_22_no_dummies_grid <- tidyr::crossing(penalty = 10^seq(-6, -1, @@ -1036,21 +1036,21 @@ dummy_template(model, prefix, verbose, tune) Output test_config_23_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> ## Since dot product calculations are used, the predictor variables ## should be on the same scale. Before centering and scaling the numeric ## predictors, any predictors with a single unique value are filtered ## out. - step_zv(all_predictors()) %>% + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_23_dummies_spec <- - svm_poly(cost = tune(), degree = tune(), scale_factor = tune()) %>% + svm_poly(cost = tune(), degree = tune(), scale_factor = tune()) |> set_mode("regression") test_config_23_dummies_workflow <- - workflow() %>% - add_recipe(test_config_23_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_23_dummies_recipe) |> add_model(test_config_23_dummies_spec) set.seed(27246) @@ -1065,21 +1065,21 @@ no_dummy_template(model, prefix, verbose, tune) Output test_config_23_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% + recipe(formula = species ~ ., data = penguins) |> ## Since dot product calculations are used, the predictor variables ## should be on the same scale. Before centering and scaling the numeric ## predictors, any predictors with a single unique value are filtered ## out. - step_zv(all_predictors()) %>% + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_23_no_dummies_spec <- - svm_poly(cost = tune(), degree = tune(), scale_factor = tune()) %>% + svm_poly(cost = tune(), degree = tune(), scale_factor = tune()) |> set_mode("classification") test_config_23_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_23_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_23_no_dummies_recipe) |> add_model(test_config_23_no_dummies_spec) set.seed(27246) @@ -1094,21 +1094,21 @@ dummy_template(model, prefix, verbose, tune) Output test_config_24_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> ## Since dot product calculations are used, the predictor variables ## should be on the same scale. Before centering and scaling the numeric ## predictors, any predictors with a single unique value are filtered ## out. - step_zv(all_predictors()) %>% + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_24_dummies_spec <- - svm_rbf(cost = tune(), rbf_sigma = tune()) %>% + svm_rbf(cost = tune(), rbf_sigma = tune()) |> set_mode("regression") test_config_24_dummies_workflow <- - workflow() %>% - add_recipe(test_config_24_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_24_dummies_recipe) |> add_model(test_config_24_dummies_spec) set.seed(27246) @@ -1123,21 +1123,21 @@ no_dummy_template(model, prefix, verbose, tune) Output test_config_24_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% + recipe(formula = species ~ ., data = penguins) |> ## Since dot product calculations are used, the predictor variables ## should be on the same scale. Before centering and scaling the numeric ## predictors, any predictors with a single unique value are filtered ## out. - step_zv(all_predictors()) %>% + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_24_no_dummies_spec <- - svm_rbf(cost = tune(), rbf_sigma = tune()) %>% + svm_rbf(cost = tune(), rbf_sigma = tune()) |> set_mode("classification") test_config_24_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_24_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_24_no_dummies_recipe) |> add_model(test_config_24_no_dummies_spec) set.seed(27246) @@ -1152,28 +1152,28 @@ dummy_template(model, prefix, verbose, tune) Output test_config_25_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> ## This model requires the predictors to be numeric. The most common ## method to convert qualitative predictors to numeric is to create ## binary indicator variables (aka dummy variables) from these ## predictors. - step_dummy(all_nominal_predictors()) %>% + step_dummy(all_nominal_predictors()) |> ## Since distance calculations are used, the predictor variables should ## be on the same scale. Before centering and scaling the numeric ## predictors, any predictors with a single unique value are filtered ## out. - step_zv(all_predictors()) %>% + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_25_dummies_spec <- - nearest_neighbor(neighbors = tune(), weight_func = tune()) %>% - set_mode("regression") %>% + nearest_neighbor(neighbors = tune(), weight_func = tune()) |> + set_mode("regression") |> set_engine("kknn") test_config_25_dummies_workflow <- - workflow() %>% - add_recipe(test_config_25_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_25_dummies_recipe) |> add_model(test_config_25_dummies_spec) set.seed(27246) @@ -1188,28 +1188,28 @@ no_dummy_template(model, prefix, verbose, tune) Output test_config_25_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% + recipe(formula = species ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> ## This model requires the predictors to be numeric. The most common ## method to convert qualitative predictors to numeric is to create ## binary indicator variables (aka dummy variables) from these ## predictors. - step_dummy(all_nominal_predictors()) %>% + step_dummy(all_nominal_predictors()) |> ## Since distance calculations are used, the predictor variables should ## be on the same scale. Before centering and scaling the numeric ## predictors, any predictors with a single unique value are filtered ## out. - step_zv(all_predictors()) %>% + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_25_no_dummies_spec <- - nearest_neighbor(neighbors = tune(), weight_func = tune()) %>% - set_mode("classification") %>% + nearest_neighbor(neighbors = tune(), weight_func = tune()) |> + set_mode("classification") |> set_engine("kknn") test_config_25_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_25_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_25_no_dummies_recipe) |> add_model(test_config_25_no_dummies_spec) set.seed(27246) @@ -1227,13 +1227,13 @@ recipe(formula = body_mass_g ~ ., data = penguins) test_config_26_dummies_spec <- - gen_additive_mod(select_features = tune(), adjust_deg_free = tune()) %>% - set_mode("regression") %>% + gen_additive_mod(select_features = tune(), adjust_deg_free = tune()) |> + set_mode("regression") |> set_engine("mgcv") test_config_26_dummies_workflow <- - workflow() %>% - add_recipe(test_config_26_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_26_dummies_recipe) |> add_model(test_config_26_dummies_spec, formula = stop("add your gam formula")) set.seed(27246) @@ -1251,13 +1251,13 @@ recipe(formula = species ~ ., data = penguins) test_config_26_no_dummies_spec <- - gen_additive_mod(select_features = tune(), adjust_deg_free = tune()) %>% - set_mode("classification") %>% + gen_additive_mod(select_features = tune(), adjust_deg_free = tune()) |> + set_mode("classification") |> set_engine("mgcv") test_config_26_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_26_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_26_no_dummies_recipe) |> add_model(test_config_26_no_dummies_spec, formula = stop("add your gam formula")) set.seed(27246) @@ -1274,24 +1274,24 @@ library(plsmod) test_config_27_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> ## This model requires the predictors to be numeric. The most common ## method to convert qualitative predictors to numeric is to create ## binary indicator variables (aka dummy variables) from these ## predictors. - step_dummy(all_nominal_predictors()) %>% - step_zv(all_predictors()) %>% + step_dummy(all_nominal_predictors()) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_27_dummies_spec <- - pls(predictor_prop = tune(), num_comp = tune()) %>% - set_mode("regression") %>% + pls(predictor_prop = tune(), num_comp = tune()) |> + set_mode("regression") |> set_engine("mixOmics") test_config_27_dummies_workflow <- - workflow() %>% - add_recipe(test_config_27_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_27_dummies_recipe) |> add_model(test_config_27_dummies_spec) set.seed(27246) @@ -1308,24 +1308,24 @@ library(plsmod) test_config_27_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% + recipe(formula = species ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> ## This model requires the predictors to be numeric. The most common ## method to convert qualitative predictors to numeric is to create ## binary indicator variables (aka dummy variables) from these ## predictors. - step_dummy(all_nominal_predictors()) %>% - step_zv(all_predictors()) %>% + step_dummy(all_nominal_predictors()) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_27_no_dummies_spec <- - pls(predictor_prop = tune(), num_comp = tune()) %>% - set_mode("classification") %>% + pls(predictor_prop = tune(), num_comp = tune()) |> + set_mode("classification") |> set_engine("mixOmics") test_config_27_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_27_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_27_no_dummies_recipe) |> add_model(test_config_27_no_dummies_spec) set.seed(27246) @@ -1340,23 +1340,23 @@ dummy_template(model, prefix, verbose, tune) Output test_config_28_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> ## This model requires the predictors to be numeric. The most common ## method to convert qualitative predictors to numeric is to create ## binary indicator variables (aka dummy variables) from these ## predictors. - step_dummy(all_nominal_predictors()) %>% - step_zv(all_predictors()) %>% + step_dummy(all_nominal_predictors()) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_28_dummies_spec <- - mlp(hidden_units = tune(), penalty = tune(), epochs = tune()) %>% + mlp(hidden_units = tune(), penalty = tune(), epochs = tune()) |> set_mode("regression") test_config_28_dummies_workflow <- - workflow() %>% - add_recipe(test_config_28_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_28_dummies_recipe) |> add_model(test_config_28_dummies_spec) set.seed(27246) @@ -1371,23 +1371,23 @@ no_dummy_template(model, prefix, verbose, tune) Output test_config_28_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% + recipe(formula = species ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> ## This model requires the predictors to be numeric. The most common ## method to convert qualitative predictors to numeric is to create ## binary indicator variables (aka dummy variables) from these ## predictors. - step_dummy(all_nominal_predictors()) %>% - step_zv(all_predictors()) %>% + step_dummy(all_nominal_predictors()) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_28_no_dummies_spec <- - mlp(hidden_units = tune(), penalty = tune(), epochs = tune()) %>% + mlp(hidden_units = tune(), penalty = tune(), epochs = tune()) |> set_mode("classification") test_config_28_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_28_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_28_no_dummies_recipe) |> add_model(test_config_28_no_dummies_spec) set.seed(27246) @@ -1405,13 +1405,13 @@ recipe(formula = body_mass_g ~ ., data = penguins) test_config_29_dummies_spec <- - rand_forest(mtry = tune(), min_n = tune(), trees = 1000) %>% - set_mode("regression") %>% + rand_forest(mtry = tune(), min_n = tune(), trees = 1000) |> + set_mode("regression") |> set_engine("ranger") test_config_29_dummies_workflow <- - workflow() %>% - add_recipe(test_config_29_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_29_dummies_recipe) |> add_model(test_config_29_dummies_spec) set.seed(27246) @@ -1429,13 +1429,13 @@ recipe(formula = species ~ ., data = penguins) test_config_29_no_dummies_spec <- - rand_forest(mtry = tune(), min_n = tune(), trees = 1000) %>% - set_mode("classification") %>% + rand_forest(mtry = tune(), min_n = tune(), trees = 1000) |> + set_mode("classification") |> set_engine("ranger") test_config_29_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_29_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_29_no_dummies_recipe) |> add_model(test_config_29_no_dummies_spec) set.seed(27246) @@ -1453,13 +1453,13 @@ recipe(formula = body_mass_g ~ ., data = penguins) test_config_30_dummies_spec <- - decision_tree(tree_depth = tune(), min_n = tune(), cost_complexity = tune()) %>% - set_mode("regression") %>% + decision_tree(tree_depth = tune(), min_n = tune(), cost_complexity = tune()) |> + set_mode("regression") |> set_engine("rpart") test_config_30_dummies_workflow <- - workflow() %>% - add_recipe(test_config_30_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_30_dummies_recipe) |> add_model(test_config_30_dummies_spec) set.seed(27246) @@ -1477,13 +1477,13 @@ recipe(formula = species ~ ., data = penguins) test_config_30_no_dummies_spec <- - decision_tree(tree_depth = tune(), min_n = tune(), cost_complexity = tune()) %>% - set_mode("classification") %>% + decision_tree(tree_depth = tune(), min_n = tune(), cost_complexity = tune()) |> + set_mode("classification") |> set_engine("rpart") test_config_30_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_30_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_30_no_dummies_recipe) |> add_model(test_config_30_no_dummies_spec) set.seed(27246) @@ -1498,26 +1498,26 @@ dummy_template(model, prefix, verbose, tune) Output test_config_31_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> ## This model requires the predictors to be numeric. The most common ## method to convert qualitative predictors to numeric is to create ## binary indicator variables (aka dummy variables) from these ## predictors. However, for this model, binary indicator variables can be ## made for each of the levels of the factors (known as 'one-hot ## encoding'). - step_dummy(all_nominal_predictors(), one_hot = TRUE) %>% + step_dummy(all_nominal_predictors(), one_hot = TRUE) |> step_zv(all_predictors()) test_config_31_dummies_spec <- boost_tree(trees = tune(), min_n = tune(), tree_depth = tune(), learn_rate = tune(), - loss_reduction = tune(), sample_size = tune()) %>% - set_mode("regression") %>% + loss_reduction = tune(), sample_size = tune()) |> + set_mode("regression") |> set_engine("xgboost") test_config_31_dummies_workflow <- - workflow() %>% - add_recipe(test_config_31_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_31_dummies_recipe) |> add_model(test_config_31_dummies_spec) set.seed(27246) @@ -1532,26 +1532,26 @@ no_dummy_template(model, prefix, verbose, tune) Output test_config_31_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% + recipe(formula = species ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> ## This model requires the predictors to be numeric. The most common ## method to convert qualitative predictors to numeric is to create ## binary indicator variables (aka dummy variables) from these ## predictors. However, for this model, binary indicator variables can be ## made for each of the levels of the factors (known as 'one-hot ## encoding'). - step_dummy(all_nominal_predictors(), one_hot = TRUE) %>% + step_dummy(all_nominal_predictors(), one_hot = TRUE) |> step_zv(all_predictors()) test_config_31_no_dummies_spec <- boost_tree(trees = tune(), min_n = tune(), tree_depth = tune(), learn_rate = tune(), - loss_reduction = tune(), sample_size = tune()) %>% - set_mode("classification") %>% + loss_reduction = tune(), sample_size = tune()) |> + set_mode("classification") |> set_engine("xgboost") test_config_31_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_31_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_31_no_dummies_recipe) |> add_model(test_config_31_no_dummies_spec) set.seed(27246) @@ -1568,25 +1568,25 @@ library(rules) test_config_32_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> ## This model requires the predictors to be numeric. The most common ## method to convert qualitative predictors to numeric is to create ## binary indicator variables (aka dummy variables) from these ## predictors. - step_dummy(all_nominal_predictors()) %>% - step_zv(all_predictors()) %>% + step_dummy(all_nominal_predictors()) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_32_dummies_spec <- rule_fit(mtry = tune(), trees = tune(), min_n = tune(), tree_depth = tune(), - learn_rate = tune(), loss_reduction = tune(), sample_size = tune(), penalty = tune()) %>% - set_mode("regression") %>% + learn_rate = tune(), loss_reduction = tune(), sample_size = tune(), penalty = tune()) |> + set_mode("regression") |> set_engine("xrf") test_config_32_dummies_workflow <- - workflow() %>% - add_recipe(test_config_32_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_32_dummies_recipe) |> add_model(test_config_32_dummies_spec) set.seed(27246) @@ -1603,25 +1603,25 @@ library(rules) test_config_32_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% + recipe(formula = species ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> ## This model requires the predictors to be numeric. The most common ## method to convert qualitative predictors to numeric is to create ## binary indicator variables (aka dummy variables) from these ## predictors. - step_dummy(all_nominal_predictors()) %>% - step_zv(all_predictors()) %>% + step_dummy(all_nominal_predictors()) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_32_no_dummies_spec <- rule_fit(mtry = tune(), trees = tune(), min_n = tune(), tree_depth = tune(), - learn_rate = tune(), loss_reduction = tune(), sample_size = tune(), penalty = tune()) %>% - set_mode("classification") %>% + learn_rate = tune(), loss_reduction = tune(), sample_size = tune(), penalty = tune()) |> + set_mode("classification") |> set_engine("xrf") test_config_32_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_32_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_32_no_dummies_recipe) |> add_model(test_config_32_no_dummies_spec) set.seed(27246) @@ -1641,13 +1641,13 @@ recipe(formula = body_mass_g ~ ., data = penguins) test_config_33_dummies_spec <- - bag_tree() %>% - set_mode("regression") %>% + bag_tree() |> + set_mode("regression") |> set_engine("rpart") test_config_33_dummies_workflow <- - workflow() %>% - add_recipe(test_config_33_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_33_dummies_recipe) |> add_model(test_config_33_dummies_spec) @@ -1662,13 +1662,13 @@ recipe(formula = species ~ ., data = penguins) test_config_33_no_dummies_spec <- - bag_tree() %>% - set_mode("classification") %>% + bag_tree() |> + set_mode("classification") |> set_engine("rpart") test_config_33_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_33_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_33_no_dummies_recipe) |> add_model(test_config_33_no_dummies_spec) @@ -1681,13 +1681,13 @@ recipe(formula = species ~ ., data = penguins) test_config_34_no_dummies_spec <- - boost_tree() %>% - set_mode("classification") %>% + boost_tree() |> + set_mode("classification") |> set_engine("C5.0") test_config_34_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_34_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_34_no_dummies_recipe) |> add_model(test_config_34_no_dummies_spec) @@ -1699,16 +1699,16 @@ library(rules) test_config_35_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> step_zv(all_predictors()) test_config_35_dummies_spec <- - cubist_rules() %>% + cubist_rules() |> set_engine("Cubist") test_config_35_dummies_workflow <- - workflow() %>% - add_recipe(test_config_35_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_35_dummies_recipe) |> add_model(test_config_35_dummies_spec) @@ -1721,13 +1721,13 @@ recipe(formula = body_mass_g ~ ., data = penguins) test_config_36_dummies_spec <- - bart() %>% - set_mode("regression") %>% + bart() |> + set_mode("regression") |> set_engine("dbarts") test_config_36_dummies_workflow <- - workflow() %>% - add_recipe(test_config_36_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_36_dummies_recipe) |> add_model(test_config_36_dummies_spec) @@ -1740,13 +1740,13 @@ recipe(formula = species ~ ., data = penguins) test_config_36_no_dummies_spec <- - bart() %>% - set_mode("classification") %>% + bart() |> + set_mode("classification") |> set_engine("dbarts") test_config_36_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_36_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_36_no_dummies_recipe) |> add_model(test_config_36_no_dummies_spec) @@ -1756,19 +1756,19 @@ dummy_template(model, prefix, verbose, tune) Output test_config_37_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% - step_dummy(all_nominal_predictors()) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> + step_dummy(all_nominal_predictors()) |> step_zv(all_predictors()) test_config_37_dummies_spec <- - mars() %>% - set_mode("regression") %>% + mars() |> + set_mode("regression") |> set_engine("earth") test_config_37_dummies_workflow <- - workflow() %>% - add_recipe(test_config_37_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_37_dummies_recipe) |> add_model(test_config_37_dummies_spec) @@ -1778,19 +1778,19 @@ no_dummy_template(model, prefix, verbose, tune) Output test_config_37_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% - step_dummy(all_nominal_predictors()) %>% + recipe(formula = species ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> + step_dummy(all_nominal_predictors()) |> step_zv(all_predictors()) test_config_37_no_dummies_spec <- - mars() %>% - set_mode("classification") %>% + mars() |> + set_mode("classification") |> set_engine("earth") test_config_37_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_37_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_37_no_dummies_recipe) |> add_model(test_config_37_no_dummies_spec) @@ -1800,20 +1800,20 @@ dummy_template(model, prefix, verbose, tune) Output test_config_38_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% - step_dummy(all_nominal_predictors()) %>% - step_zv(all_predictors()) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> + step_dummy(all_nominal_predictors()) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_38_dummies_spec <- - linear_reg() %>% - set_mode("regression") %>% + linear_reg() |> + set_mode("regression") |> set_engine("glmnet") test_config_38_dummies_workflow <- - workflow() %>% - add_recipe(test_config_38_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_38_dummies_recipe) |> add_model(test_config_38_dummies_spec) @@ -1823,20 +1823,20 @@ no_dummy_template(model, prefix, verbose, tune) Output test_config_38_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% - step_dummy(all_nominal_predictors()) %>% - step_zv(all_predictors()) %>% + recipe(formula = species ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> + step_dummy(all_nominal_predictors()) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_38_no_dummies_spec <- - multinom_reg() %>% - set_mode("classification") %>% + multinom_reg() |> + set_mode("classification") |> set_engine("glmnet") test_config_38_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_38_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_38_no_dummies_recipe) |> add_model(test_config_38_no_dummies_spec) @@ -1846,17 +1846,17 @@ dummy_template(model, prefix, verbose, tune) Output test_config_39_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% - step_zv(all_predictors()) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_39_dummies_spec <- - svm_poly() %>% + svm_poly() |> set_mode("regression") test_config_39_dummies_workflow <- - workflow() %>% - add_recipe(test_config_39_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_39_dummies_recipe) |> add_model(test_config_39_dummies_spec) @@ -1866,17 +1866,17 @@ no_dummy_template(model, prefix, verbose, tune) Output test_config_39_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% - step_zv(all_predictors()) %>% + recipe(formula = species ~ ., data = penguins) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_39_no_dummies_spec <- - svm_poly() %>% + svm_poly() |> set_mode("classification") test_config_39_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_39_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_39_no_dummies_recipe) |> add_model(test_config_39_no_dummies_spec) @@ -1886,17 +1886,17 @@ dummy_template(model, prefix, verbose, tune) Output test_config_40_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% - step_zv(all_predictors()) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_40_dummies_spec <- - svm_rbf() %>% + svm_rbf() |> set_mode("regression") test_config_40_dummies_workflow <- - workflow() %>% - add_recipe(test_config_40_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_40_dummies_recipe) |> add_model(test_config_40_dummies_spec) @@ -1906,17 +1906,17 @@ no_dummy_template(model, prefix, verbose, tune) Output test_config_40_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% - step_zv(all_predictors()) %>% + recipe(formula = species ~ ., data = penguins) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_40_no_dummies_spec <- - svm_rbf() %>% + svm_rbf() |> set_mode("classification") test_config_40_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_40_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_40_no_dummies_recipe) |> add_model(test_config_40_no_dummies_spec) @@ -1926,20 +1926,20 @@ dummy_template(model, prefix, verbose, tune) Output test_config_41_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% - step_dummy(all_nominal_predictors()) %>% - step_zv(all_predictors()) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> + step_dummy(all_nominal_predictors()) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_41_dummies_spec <- - nearest_neighbor() %>% - set_mode("regression") %>% + nearest_neighbor() |> + set_mode("regression") |> set_engine("kknn") test_config_41_dummies_workflow <- - workflow() %>% - add_recipe(test_config_41_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_41_dummies_recipe) |> add_model(test_config_41_dummies_spec) @@ -1949,20 +1949,20 @@ no_dummy_template(model, prefix, verbose, tune) Output test_config_41_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% - step_dummy(all_nominal_predictors()) %>% - step_zv(all_predictors()) %>% + recipe(formula = species ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> + step_dummy(all_nominal_predictors()) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_41_no_dummies_spec <- - nearest_neighbor() %>% - set_mode("classification") %>% + nearest_neighbor() |> + set_mode("classification") |> set_engine("kknn") test_config_41_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_41_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_41_no_dummies_recipe) |> add_model(test_config_41_no_dummies_spec) @@ -1975,13 +1975,13 @@ recipe(formula = body_mass_g ~ ., data = penguins) test_config_42_dummies_spec <- - gen_additive_mod() %>% - set_mode("regression") %>% + gen_additive_mod() |> + set_mode("regression") |> set_engine("mgcv") test_config_42_dummies_workflow <- - workflow() %>% - add_recipe(test_config_42_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_42_dummies_recipe) |> add_model(test_config_42_dummies_spec, formula = stop("add your gam formula")) @@ -1994,13 +1994,13 @@ recipe(formula = species ~ ., data = penguins) test_config_42_no_dummies_spec <- - gen_additive_mod() %>% - set_mode("classification") %>% + gen_additive_mod() |> + set_mode("classification") |> set_engine("mgcv") test_config_42_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_42_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_42_no_dummies_recipe) |> add_model(test_config_42_no_dummies_spec, formula = stop("add your gam formula")) @@ -2012,20 +2012,20 @@ library(plsmod) test_config_43_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% - step_dummy(all_nominal_predictors()) %>% - step_zv(all_predictors()) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> + step_dummy(all_nominal_predictors()) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_43_dummies_spec <- - pls() %>% - set_mode("regression") %>% + pls() |> + set_mode("regression") |> set_engine("mixOmics") test_config_43_dummies_workflow <- - workflow() %>% - add_recipe(test_config_43_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_43_dummies_recipe) |> add_model(test_config_43_dummies_spec) @@ -2037,20 +2037,20 @@ library(plsmod) test_config_43_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% - step_dummy(all_nominal_predictors()) %>% - step_zv(all_predictors()) %>% + recipe(formula = species ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> + step_dummy(all_nominal_predictors()) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_43_no_dummies_spec <- - pls() %>% - set_mode("classification") %>% + pls() |> + set_mode("classification") |> set_engine("mixOmics") test_config_43_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_43_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_43_no_dummies_recipe) |> add_model(test_config_43_no_dummies_spec) @@ -2060,19 +2060,19 @@ dummy_template(model, prefix, verbose, tune) Output test_config_44_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% - step_dummy(all_nominal_predictors()) %>% - step_zv(all_predictors()) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> + step_dummy(all_nominal_predictors()) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_44_dummies_spec <- - mlp() %>% + mlp() |> set_mode("regression") test_config_44_dummies_workflow <- - workflow() %>% - add_recipe(test_config_44_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_44_dummies_recipe) |> add_model(test_config_44_dummies_spec) @@ -2082,19 +2082,19 @@ no_dummy_template(model, prefix, verbose, tune) Output test_config_44_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% - step_dummy(all_nominal_predictors()) %>% - step_zv(all_predictors()) %>% + recipe(formula = species ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> + step_dummy(all_nominal_predictors()) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_44_no_dummies_spec <- - mlp() %>% + mlp() |> set_mode("classification") test_config_44_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_44_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_44_no_dummies_recipe) |> add_model(test_config_44_no_dummies_spec) @@ -2107,13 +2107,13 @@ recipe(formula = body_mass_g ~ ., data = penguins) test_config_45_dummies_spec <- - rand_forest(trees = 1000) %>% - set_mode("regression") %>% + rand_forest(trees = 1000) |> + set_mode("regression") |> set_engine("ranger") test_config_45_dummies_workflow <- - workflow() %>% - add_recipe(test_config_45_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_45_dummies_recipe) |> add_model(test_config_45_dummies_spec) @@ -2126,13 +2126,13 @@ recipe(formula = species ~ ., data = penguins) test_config_45_no_dummies_spec <- - rand_forest(trees = 1000) %>% - set_mode("classification") %>% + rand_forest(trees = 1000) |> + set_mode("classification") |> set_engine("ranger") test_config_45_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_45_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_45_no_dummies_recipe) |> add_model(test_config_45_no_dummies_spec) @@ -2145,13 +2145,13 @@ recipe(formula = body_mass_g ~ ., data = penguins) test_config_46_dummies_spec <- - decision_tree() %>% - set_mode("regression") %>% + decision_tree() |> + set_mode("regression") |> set_engine("rpart") test_config_46_dummies_workflow <- - workflow() %>% - add_recipe(test_config_46_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_46_dummies_recipe) |> add_model(test_config_46_dummies_spec) @@ -2164,13 +2164,13 @@ recipe(formula = species ~ ., data = penguins) test_config_46_no_dummies_spec <- - decision_tree() %>% - set_mode("classification") %>% + decision_tree() |> + set_mode("classification") |> set_engine("rpart") test_config_46_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_46_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_46_no_dummies_recipe) |> add_model(test_config_46_no_dummies_spec) @@ -2180,19 +2180,19 @@ dummy_template(model, prefix, verbose, tune) Output test_config_47_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% - step_dummy(all_nominal_predictors(), one_hot = TRUE) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> + step_dummy(all_nominal_predictors(), one_hot = TRUE) |> step_zv(all_predictors()) test_config_47_dummies_spec <- - boost_tree() %>% - set_mode("regression") %>% + boost_tree() |> + set_mode("regression") |> set_engine("xgboost") test_config_47_dummies_workflow <- - workflow() %>% - add_recipe(test_config_47_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_47_dummies_recipe) |> add_model(test_config_47_dummies_spec) @@ -2202,19 +2202,19 @@ no_dummy_template(model, prefix, verbose, tune) Output test_config_47_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% - step_dummy(all_nominal_predictors(), one_hot = TRUE) %>% + recipe(formula = species ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> + step_dummy(all_nominal_predictors(), one_hot = TRUE) |> step_zv(all_predictors()) test_config_47_no_dummies_spec <- - boost_tree() %>% - set_mode("classification") %>% + boost_tree() |> + set_mode("classification") |> set_engine("xgboost") test_config_47_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_47_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_47_no_dummies_recipe) |> add_model(test_config_47_no_dummies_spec) @@ -2226,20 +2226,20 @@ library(rules) test_config_48_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% - step_dummy(all_nominal_predictors()) %>% - step_zv(all_predictors()) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> + step_dummy(all_nominal_predictors()) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_48_dummies_spec <- - rule_fit() %>% - set_mode("regression") %>% + rule_fit() |> + set_mode("regression") |> set_engine("xrf") test_config_48_dummies_workflow <- - workflow() %>% - add_recipe(test_config_48_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_48_dummies_recipe) |> add_model(test_config_48_dummies_spec) @@ -2251,20 +2251,20 @@ library(rules) test_config_48_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% - step_dummy(all_nominal_predictors()) %>% - step_zv(all_predictors()) %>% + recipe(formula = species ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> + step_dummy(all_nominal_predictors()) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_48_no_dummies_spec <- - rule_fit() %>% - set_mode("classification") %>% + rule_fit() |> + set_mode("classification") |> set_engine("xrf") test_config_48_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_48_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_48_no_dummies_recipe) |> add_model(test_config_48_no_dummies_spec) @@ -2279,13 +2279,13 @@ recipe(formula = body_mass_g ~ ., data = penguins) test_config_49_dummies_spec <- - bag_tree(tree_depth = tune(), min_n = tune(), cost_complexity = tune()) %>% - set_mode("regression") %>% + bag_tree(tree_depth = tune(), min_n = tune(), cost_complexity = tune()) |> + set_mode("regression") |> set_engine("rpart") test_config_49_dummies_workflow <- - workflow() %>% - add_recipe(test_config_49_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_49_dummies_recipe) |> add_model(test_config_49_dummies_spec) set.seed(27246) @@ -2305,13 +2305,13 @@ recipe(formula = species ~ ., data = penguins) test_config_49_no_dummies_spec <- - bag_tree(tree_depth = tune(), min_n = tune(), cost_complexity = tune()) %>% - set_mode("classification") %>% + bag_tree(tree_depth = tune(), min_n = tune(), cost_complexity = tune()) |> + set_mode("classification") |> set_engine("rpart") test_config_49_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_49_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_49_no_dummies_recipe) |> add_model(test_config_49_no_dummies_spec) set.seed(27246) @@ -2329,13 +2329,13 @@ recipe(formula = species ~ ., data = penguins) test_config_50_no_dummies_spec <- - boost_tree(trees = tune(), min_n = tune()) %>% - set_mode("classification") %>% + boost_tree(trees = tune(), min_n = tune()) |> + set_mode("classification") |> set_engine("C5.0") test_config_50_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_50_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_50_no_dummies_recipe) |> add_model(test_config_50_no_dummies_spec) set.seed(27246) @@ -2352,16 +2352,16 @@ library(rules) test_config_51_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> step_zv(all_predictors()) test_config_51_dummies_spec <- - cubist_rules(committees = tune(), neighbors = tune()) %>% + cubist_rules(committees = tune(), neighbors = tune()) |> set_engine("Cubist") test_config_51_dummies_workflow <- - workflow() %>% - add_recipe(test_config_51_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_51_dummies_recipe) |> add_model(test_config_51_dummies_spec) test_config_51_dummies_grid <- tidyr::crossing(committees = c(1:9, (1:5) * @@ -2381,13 +2381,13 @@ recipe(formula = body_mass_g ~ ., data = penguins) test_config_52_dummies_spec <- - bart(trees = tune(), prior_terminal_node_coef = tune(), prior_terminal_node_expo = tune()) %>% - set_mode("regression") %>% + bart(trees = tune(), prior_terminal_node_coef = tune(), prior_terminal_node_expo = tune()) |> + set_mode("regression") |> set_engine("dbarts") test_config_52_dummies_workflow <- - workflow() %>% - add_recipe(test_config_52_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_52_dummies_recipe) |> add_model(test_config_52_dummies_spec) set.seed(27246) @@ -2405,13 +2405,13 @@ recipe(formula = species ~ ., data = penguins) test_config_52_no_dummies_spec <- - bart(trees = tune(), prior_terminal_node_coef = tune(), prior_terminal_node_expo = tune()) %>% - set_mode("classification") %>% + bart(trees = tune(), prior_terminal_node_coef = tune(), prior_terminal_node_expo = tune()) |> + set_mode("classification") |> set_engine("dbarts") test_config_52_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_52_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_52_no_dummies_recipe) |> add_model(test_config_52_no_dummies_spec) set.seed(27246) @@ -2426,19 +2426,19 @@ dummy_template(model, prefix, verbose, tune) Output test_config_53_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% - step_dummy(all_nominal_predictors()) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> + step_dummy(all_nominal_predictors()) |> step_zv(all_predictors()) test_config_53_dummies_spec <- - mars(num_terms = tune(), prod_degree = tune(), prune_method = "none") %>% - set_mode("regression") %>% + mars(num_terms = tune(), prod_degree = tune(), prune_method = "none") |> + set_mode("regression") |> set_engine("earth") test_config_53_dummies_workflow <- - workflow() %>% - add_recipe(test_config_53_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_53_dummies_recipe) |> add_model(test_config_53_dummies_spec) test_config_53_dummies_grid <- tidyr::crossing(num_terms = 2 * (1:6), prod_degree = 1:2) @@ -2454,19 +2454,19 @@ no_dummy_template(model, prefix, verbose, tune) Output test_config_53_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% - step_dummy(all_nominal_predictors()) %>% + recipe(formula = species ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> + step_dummy(all_nominal_predictors()) |> step_zv(all_predictors()) test_config_53_no_dummies_spec <- - mars(num_terms = tune(), prod_degree = tune(), prune_method = "none") %>% - set_mode("classification") %>% + mars(num_terms = tune(), prod_degree = tune(), prune_method = "none") |> + set_mode("classification") |> set_engine("earth") test_config_53_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_53_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_53_no_dummies_recipe) |> add_model(test_config_53_no_dummies_spec) test_config_53_no_dummies_grid <- tidyr::crossing(num_terms = 2 * (1:6), prod_degree = 1:2) @@ -2482,20 +2482,20 @@ dummy_template(model, prefix, verbose, tune) Output test_config_54_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% - step_dummy(all_nominal_predictors()) %>% - step_zv(all_predictors()) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> + step_dummy(all_nominal_predictors()) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_54_dummies_spec <- - linear_reg(penalty = tune(), mixture = tune()) %>% - set_mode("regression") %>% + linear_reg(penalty = tune(), mixture = tune()) |> + set_mode("regression") |> set_engine("glmnet") test_config_54_dummies_workflow <- - workflow() %>% - add_recipe(test_config_54_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_54_dummies_recipe) |> add_model(test_config_54_dummies_spec) test_config_54_dummies_grid <- tidyr::crossing(penalty = 10^seq(-6, -1, length.out = 20), @@ -2512,20 +2512,20 @@ no_dummy_template(model, prefix, verbose, tune) Output test_config_54_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% - step_dummy(all_nominal_predictors()) %>% - step_zv(all_predictors()) %>% + recipe(formula = species ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> + step_dummy(all_nominal_predictors()) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_54_no_dummies_spec <- - multinom_reg(penalty = tune(), mixture = tune()) %>% - set_mode("classification") %>% + multinom_reg(penalty = tune(), mixture = tune()) |> + set_mode("classification") |> set_engine("glmnet") test_config_54_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_54_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_54_no_dummies_recipe) |> add_model(test_config_54_no_dummies_spec) test_config_54_no_dummies_grid <- tidyr::crossing(penalty = 10^seq(-6, -1, @@ -2542,17 +2542,17 @@ dummy_template(model, prefix, verbose, tune) Output test_config_55_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% - step_zv(all_predictors()) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_55_dummies_spec <- - svm_poly(cost = tune(), degree = tune(), scale_factor = tune()) %>% + svm_poly(cost = tune(), degree = tune(), scale_factor = tune()) |> set_mode("regression") test_config_55_dummies_workflow <- - workflow() %>% - add_recipe(test_config_55_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_55_dummies_recipe) |> add_model(test_config_55_dummies_spec) set.seed(27246) @@ -2567,17 +2567,17 @@ no_dummy_template(model, prefix, verbose, tune) Output test_config_55_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% - step_zv(all_predictors()) %>% + recipe(formula = species ~ ., data = penguins) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_55_no_dummies_spec <- - svm_poly(cost = tune(), degree = tune(), scale_factor = tune()) %>% + svm_poly(cost = tune(), degree = tune(), scale_factor = tune()) |> set_mode("classification") test_config_55_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_55_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_55_no_dummies_recipe) |> add_model(test_config_55_no_dummies_spec) set.seed(27246) @@ -2592,17 +2592,17 @@ dummy_template(model, prefix, verbose, tune) Output test_config_56_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% - step_zv(all_predictors()) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_56_dummies_spec <- - svm_rbf(cost = tune(), rbf_sigma = tune()) %>% + svm_rbf(cost = tune(), rbf_sigma = tune()) |> set_mode("regression") test_config_56_dummies_workflow <- - workflow() %>% - add_recipe(test_config_56_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_56_dummies_recipe) |> add_model(test_config_56_dummies_spec) set.seed(27246) @@ -2617,17 +2617,17 @@ no_dummy_template(model, prefix, verbose, tune) Output test_config_56_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% - step_zv(all_predictors()) %>% + recipe(formula = species ~ ., data = penguins) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_56_no_dummies_spec <- - svm_rbf(cost = tune(), rbf_sigma = tune()) %>% + svm_rbf(cost = tune(), rbf_sigma = tune()) |> set_mode("classification") test_config_56_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_56_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_56_no_dummies_recipe) |> add_model(test_config_56_no_dummies_spec) set.seed(27246) @@ -2642,20 +2642,20 @@ dummy_template(model, prefix, verbose, tune) Output test_config_57_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% - step_dummy(all_nominal_predictors()) %>% - step_zv(all_predictors()) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> + step_dummy(all_nominal_predictors()) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_57_dummies_spec <- - nearest_neighbor(neighbors = tune(), weight_func = tune()) %>% - set_mode("regression") %>% + nearest_neighbor(neighbors = tune(), weight_func = tune()) |> + set_mode("regression") |> set_engine("kknn") test_config_57_dummies_workflow <- - workflow() %>% - add_recipe(test_config_57_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_57_dummies_recipe) |> add_model(test_config_57_dummies_spec) set.seed(27246) @@ -2670,20 +2670,20 @@ no_dummy_template(model, prefix, verbose, tune) Output test_config_57_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% - step_dummy(all_nominal_predictors()) %>% - step_zv(all_predictors()) %>% + recipe(formula = species ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> + step_dummy(all_nominal_predictors()) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_57_no_dummies_spec <- - nearest_neighbor(neighbors = tune(), weight_func = tune()) %>% - set_mode("classification") %>% + nearest_neighbor(neighbors = tune(), weight_func = tune()) |> + set_mode("classification") |> set_engine("kknn") test_config_57_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_57_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_57_no_dummies_recipe) |> add_model(test_config_57_no_dummies_spec) set.seed(27246) @@ -2701,13 +2701,13 @@ recipe(formula = body_mass_g ~ ., data = penguins) test_config_58_dummies_spec <- - gen_additive_mod(select_features = tune(), adjust_deg_free = tune()) %>% - set_mode("regression") %>% + gen_additive_mod(select_features = tune(), adjust_deg_free = tune()) |> + set_mode("regression") |> set_engine("mgcv") test_config_58_dummies_workflow <- - workflow() %>% - add_recipe(test_config_58_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_58_dummies_recipe) |> add_model(test_config_58_dummies_spec, formula = stop("add your gam formula")) set.seed(27246) @@ -2725,13 +2725,13 @@ recipe(formula = species ~ ., data = penguins) test_config_58_no_dummies_spec <- - gen_additive_mod(select_features = tune(), adjust_deg_free = tune()) %>% - set_mode("classification") %>% + gen_additive_mod(select_features = tune(), adjust_deg_free = tune()) |> + set_mode("classification") |> set_engine("mgcv") test_config_58_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_58_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_58_no_dummies_recipe) |> add_model(test_config_58_no_dummies_spec, formula = stop("add your gam formula")) set.seed(27246) @@ -2748,20 +2748,20 @@ library(plsmod) test_config_59_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% - step_dummy(all_nominal_predictors()) %>% - step_zv(all_predictors()) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> + step_dummy(all_nominal_predictors()) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_59_dummies_spec <- - pls(predictor_prop = tune(), num_comp = tune()) %>% - set_mode("regression") %>% + pls(predictor_prop = tune(), num_comp = tune()) |> + set_mode("regression") |> set_engine("mixOmics") test_config_59_dummies_workflow <- - workflow() %>% - add_recipe(test_config_59_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_59_dummies_recipe) |> add_model(test_config_59_dummies_spec) set.seed(27246) @@ -2778,20 +2778,20 @@ library(plsmod) test_config_59_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% - step_dummy(all_nominal_predictors()) %>% - step_zv(all_predictors()) %>% + recipe(formula = species ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> + step_dummy(all_nominal_predictors()) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_59_no_dummies_spec <- - pls(predictor_prop = tune(), num_comp = tune()) %>% - set_mode("classification") %>% + pls(predictor_prop = tune(), num_comp = tune()) |> + set_mode("classification") |> set_engine("mixOmics") test_config_59_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_59_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_59_no_dummies_recipe) |> add_model(test_config_59_no_dummies_spec) set.seed(27246) @@ -2806,19 +2806,19 @@ dummy_template(model, prefix, verbose, tune) Output test_config_60_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% - step_dummy(all_nominal_predictors()) %>% - step_zv(all_predictors()) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> + step_dummy(all_nominal_predictors()) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_60_dummies_spec <- - mlp(hidden_units = tune(), penalty = tune(), epochs = tune()) %>% + mlp(hidden_units = tune(), penalty = tune(), epochs = tune()) |> set_mode("regression") test_config_60_dummies_workflow <- - workflow() %>% - add_recipe(test_config_60_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_60_dummies_recipe) |> add_model(test_config_60_dummies_spec) set.seed(27246) @@ -2833,19 +2833,19 @@ no_dummy_template(model, prefix, verbose, tune) Output test_config_60_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% - step_dummy(all_nominal_predictors()) %>% - step_zv(all_predictors()) %>% + recipe(formula = species ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> + step_dummy(all_nominal_predictors()) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_60_no_dummies_spec <- - mlp(hidden_units = tune(), penalty = tune(), epochs = tune()) %>% + mlp(hidden_units = tune(), penalty = tune(), epochs = tune()) |> set_mode("classification") test_config_60_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_60_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_60_no_dummies_recipe) |> add_model(test_config_60_no_dummies_spec) set.seed(27246) @@ -2863,13 +2863,13 @@ recipe(formula = body_mass_g ~ ., data = penguins) test_config_61_dummies_spec <- - rand_forest(mtry = tune(), min_n = tune(), trees = 1000) %>% - set_mode("regression") %>% + rand_forest(mtry = tune(), min_n = tune(), trees = 1000) |> + set_mode("regression") |> set_engine("ranger") test_config_61_dummies_workflow <- - workflow() %>% - add_recipe(test_config_61_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_61_dummies_recipe) |> add_model(test_config_61_dummies_spec) set.seed(27246) @@ -2887,13 +2887,13 @@ recipe(formula = species ~ ., data = penguins) test_config_61_no_dummies_spec <- - rand_forest(mtry = tune(), min_n = tune(), trees = 1000) %>% - set_mode("classification") %>% + rand_forest(mtry = tune(), min_n = tune(), trees = 1000) |> + set_mode("classification") |> set_engine("ranger") test_config_61_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_61_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_61_no_dummies_recipe) |> add_model(test_config_61_no_dummies_spec) set.seed(27246) @@ -2911,13 +2911,13 @@ recipe(formula = body_mass_g ~ ., data = penguins) test_config_62_dummies_spec <- - decision_tree(tree_depth = tune(), min_n = tune(), cost_complexity = tune()) %>% - set_mode("regression") %>% + decision_tree(tree_depth = tune(), min_n = tune(), cost_complexity = tune()) |> + set_mode("regression") |> set_engine("rpart") test_config_62_dummies_workflow <- - workflow() %>% - add_recipe(test_config_62_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_62_dummies_recipe) |> add_model(test_config_62_dummies_spec) set.seed(27246) @@ -2935,13 +2935,13 @@ recipe(formula = species ~ ., data = penguins) test_config_62_no_dummies_spec <- - decision_tree(tree_depth = tune(), min_n = tune(), cost_complexity = tune()) %>% - set_mode("classification") %>% + decision_tree(tree_depth = tune(), min_n = tune(), cost_complexity = tune()) |> + set_mode("classification") |> set_engine("rpart") test_config_62_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_62_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_62_no_dummies_recipe) |> add_model(test_config_62_no_dummies_spec) set.seed(27246) @@ -2956,20 +2956,20 @@ dummy_template(model, prefix, verbose, tune) Output test_config_63_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% - step_dummy(all_nominal_predictors(), one_hot = TRUE) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> + step_dummy(all_nominal_predictors(), one_hot = TRUE) |> step_zv(all_predictors()) test_config_63_dummies_spec <- boost_tree(trees = tune(), min_n = tune(), tree_depth = tune(), learn_rate = tune(), - loss_reduction = tune(), sample_size = tune()) %>% - set_mode("regression") %>% + loss_reduction = tune(), sample_size = tune()) |> + set_mode("regression") |> set_engine("xgboost") test_config_63_dummies_workflow <- - workflow() %>% - add_recipe(test_config_63_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_63_dummies_recipe) |> add_model(test_config_63_dummies_spec) set.seed(27246) @@ -2984,20 +2984,20 @@ no_dummy_template(model, prefix, verbose, tune) Output test_config_63_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% - step_dummy(all_nominal_predictors(), one_hot = TRUE) %>% + recipe(formula = species ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> + step_dummy(all_nominal_predictors(), one_hot = TRUE) |> step_zv(all_predictors()) test_config_63_no_dummies_spec <- boost_tree(trees = tune(), min_n = tune(), tree_depth = tune(), learn_rate = tune(), - loss_reduction = tune(), sample_size = tune()) %>% - set_mode("classification") %>% + loss_reduction = tune(), sample_size = tune()) |> + set_mode("classification") |> set_engine("xgboost") test_config_63_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_63_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_63_no_dummies_recipe) |> add_model(test_config_63_no_dummies_spec) set.seed(27246) @@ -3014,21 +3014,21 @@ library(rules) test_config_64_dummies_recipe <- - recipe(formula = body_mass_g ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% - step_dummy(all_nominal_predictors()) %>% - step_zv(all_predictors()) %>% + recipe(formula = body_mass_g ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> + step_dummy(all_nominal_predictors()) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_64_dummies_spec <- rule_fit(mtry = tune(), trees = tune(), min_n = tune(), tree_depth = tune(), - learn_rate = tune(), loss_reduction = tune(), sample_size = tune(), penalty = tune()) %>% - set_mode("regression") %>% + learn_rate = tune(), loss_reduction = tune(), sample_size = tune(), penalty = tune()) |> + set_mode("regression") |> set_engine("xrf") test_config_64_dummies_workflow <- - workflow() %>% - add_recipe(test_config_64_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_64_dummies_recipe) |> add_model(test_config_64_dummies_spec) set.seed(27246) @@ -3045,21 +3045,21 @@ library(rules) test_config_64_no_dummies_recipe <- - recipe(formula = species ~ ., data = penguins) %>% - step_novel(all_nominal_predictors()) %>% - step_dummy(all_nominal_predictors()) %>% - step_zv(all_predictors()) %>% + recipe(formula = species ~ ., data = penguins) |> + step_novel(all_nominal_predictors()) |> + step_dummy(all_nominal_predictors()) |> + step_zv(all_predictors()) |> step_normalize(all_numeric_predictors()) test_config_64_no_dummies_spec <- rule_fit(mtry = tune(), trees = tune(), min_n = tune(), tree_depth = tune(), - learn_rate = tune(), loss_reduction = tune(), sample_size = tune(), penalty = tune()) %>% - set_mode("classification") %>% + learn_rate = tune(), loss_reduction = tune(), sample_size = tune(), penalty = tune()) |> + set_mode("classification") |> set_engine("xrf") test_config_64_no_dummies_workflow <- - workflow() %>% - add_recipe(test_config_64_no_dummies_recipe) %>% + workflow() |> + add_recipe(test_config_64_no_dummies_recipe) |> add_model(test_config_64_no_dummies_spec) set.seed(27246)