# 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)
yj_transform <- step_YeoJohnson(rec, all_numeric())
yj_estimates <- prep(yj_transform, training = biomass_tr)
yj_te <- bake(yj_estimates, biomass_te)
plot(density(biomass_te$sulfur), main = "before")
plot(density(yj_te$sulfur), main = "after")
tidy(yj_transform, number = 1)
tidy(yj_estimates, number = 1)
# }
Run the code above in your browser using DataLab