if (FALSE) {
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
)
im_trans <- rec %>%
step_YeoJohnson(all_numeric_predictors()) %>%
step_normalize(all_numeric_predictors()) %>%
step_isomap(all_numeric_predictors(), neighbors = 100, num_terms = 2)
im_estimates <- prep(im_trans, training = biomass_tr)
im_te <- bake(im_estimates, biomass_te)
rng <- extendrange(c(im_te$Isomap1, im_te$Isomap2))
plot(im_te$Isomap1, im_te$Isomap2,
xlim = rng, ylim = rng
)
tidy(im_trans, number = 3)
tidy(im_estimates, number = 3)
}
Run the code above in your browser using DataLab