# NOT RUN {
library(modeldata)
data(biomass)
biomass_tr <- biomass[biomass$dataset == "Training",]
biomass_te <- biomass[biomass$dataset == "Testing",]
rec <- recipe(HHV ~ carbon + hydrogen + oxygen + nitrogen + sulfur,
data = biomass_tr)
sp_signed <- rec %>%
step_normalize(all_predictors()) %>%
step_spatialsign(all_predictors())
sp_signed_trained <- prep(sp_signed, training = biomass_tr)
tr_values <- bake(sp_signed_trained, new_data = biomass_tr, all_predictors())
og_values <- juice(sp_signed_trained, all_predictors())
all.equal(tr_values, og_values)
# }
Run the code above in your browser using DataLab