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
)
with_splines <- rec %>%
step_bs(carbon, hydrogen)
with_splines <- prep(with_splines, training = biomass_tr)
expanded <- bake(with_splines, biomass_te)
expanded
Run the code above in your browser using DataLab