# NOT RUN {
library(recipes)
library(MASS)
rec <- recipe(medv ~ ., data = Boston) %>%
step_pca(all_numeric(), -all_outcomes(), id = "pca")
grid <- expand_steps(
pca = list(num_comp = 1:3)
)
fit(TunedRecipe(rec, grid = grid), model = GLMModel)
# }
Run the code above in your browser using DataLab