diff --git a/_episodes_rmd/03-regression-regularisation.Rmd b/_episodes_rmd/03-regression-regularisation.Rmd index 23ae7117..7e767e60 100644 --- a/_episodes_rmd/03-regression-regularisation.Rmd +++ b/_episodes_rmd/03-regression-regularisation.Rmd @@ -127,12 +127,12 @@ than observations. > visualise patterns when there are too many features!). > > ```{r corr-mat-meth, fig.cap="Cap", fig.alt="Alt"} +library("ComplexHeatmap") > small <- methyl_mat[, 1:500] > cor_mat <- cor(small) > Heatmap(cor_mat, > column_title = "Feature-feature correlation in methylation data", > name = "Pearson correlation", -> col = col, > show_row_dend = FALSE, show_column_dend = FALSE, > show_row_names = FALSE, show_column_names = FALSE > ) @@ -1049,8 +1049,7 @@ plot_elastic(0.75) > update_role(age, new_role = "outcome") %>% > ## center and scale all the predictors > step_center(all_predictors()) %>% -> step_scale(all_predictors()) %>% -> prep(training = training(split_data), retain = TRUE) +> step_scale(all_predictors()) > > ## set the "engine" to be a linear model with tunable alpha and lambda > glmnet_model <- linear_reg(penalty = tune(), mixture = tune()) %>% @@ -1062,7 +1061,7 @@ plot_elastic(0.75) > add_model(glmnet_model) > > ## 5-fold cross-validation repeated 5 times -> folds <- vfold_cv(training(split_data), v = 5, repetitions = 5) +> folds <- vfold_cv(training(split_data), v = 5, repeats = 5) > > ## define a grid of lambda and alpha parameters to search > glmn_set <- parameters(