# NOT RUN {
data(biomass)
biomass_tr <- biomass[biomass$dataset == "Training",]
biomass_te <- biomass[biomass$dataset == "Testing",]
pls_rec <- recipe(HHV ~ ., data = biomass_tr) %>%
step_rm(sample, dataset) %>%
step_normalize(all_predictors()) %>%
# If the outcome(s) need standardization, do it in separate
# steps with skip = FALSE so that new data where the
# outcome is missing can be processed.
step_normalize(all_outcomes(), skip = TRUE) %>%
step_pls(all_predictors(), outcome = "HHV")
pls_rec <- prep(pls_rec, training = biomass_tr, retain = TRUE)
pls_test_scores <- bake(pls_rec, new_data = biomass_te[, -8])
tidy(pls_rec, number = 4)
# }
Run the code above in your browser using DataLab