library(recipes)
data(Boston, package = "MASS")
rec <- recipe(medv ~ ., data = Boston) %>%
step_corr(all_numeric_predictors(), id = "corr") %>%
step_pca(all_numeric_predictors(), id = "pca")
expand_steps(
corr = list(threshold = c(0.8, 0.9),
method = c("pearson", "spearman")),
pca = list(num_comp = 1:3)
)
Run the code above in your browser using DataLab