Learn R Programming

butcher (version 0.3.5)

axe-train.recipe: Axing a train.recipe object.

Description

train.recipe objects are slightly different from train objects created from the caret package in that it also includes instructions from a recipe for data pre-processing. Axing functions specific to train.recipe are thus included as additional steps are required to remove parts of train.recipe objects.

Usage

# S3 method for train.recipe
axe_call(x, ...)

# S3 method for train.recipe axe_ctrl(x, ...)

# S3 method for train.recipe axe_data(x, ...)

# S3 method for train.recipe axe_env(x, ...)

# S3 method for train.recipe axe_fitted(x, ...)

Value

Axed train.recipe object.

Arguments

x

A model object.

...

Any additional arguments related to axing.

Examples

Run this code
if (FALSE) { # interactive() || identical(Sys.getenv("IN_PKGDOWN"), "true")
library(recipes)
library(caret)
data(biomass, package = "modeldata")

data(biomass)
recipe <- biomass %>%
  recipe(HHV ~ carbon + hydrogen + oxygen + nitrogen + sulfur) %>%
  step_center(all_predictors()) %>%
  step_scale(all_predictors()) %>%
  step_spatialsign(all_predictors())

train.recipe_fit <- train(recipe, biomass,
                          method = "svmRadial",
                          metric = "RMSE")

out <- butcher(train.recipe_fit, verbose = TRUE)
}

Run the code above in your browser using DataLab