data(biomass, package = "modeldata")
biomass_tr <- biomass[biomass$dataset == "Training", ]
biomass_te <- biomass[biomass$dataset == "Testing", ]
rec <- recipe(
HHV ~ carbon + hydrogen + oxygen + nitrogen + sulfur,
data = biomass_tr
)
scaled_trans <- rec %>%
step_scale(carbon, hydrogen)
scaled_obj <- prep(scaled_trans, training = biomass_tr)
transformed_te <- bake(scaled_obj, biomass_te)
biomass_te[1:10, names(transformed_te)]
transformed_te
tidy(scaled_trans, number = 1)
tidy(scaled_obj, number = 1)
Run the code above in your browser using DataLab