R-Machine-Learning-Legacy icon indicating copy to clipboard operation
R-Machine-Learning-Legacy copied to clipboard

Solutions for 04_regularization

Open leahhrlee opened this issue 1 year ago • 1 comments

Solutions for 04_regularization should include:

Import data

penguins <- palmerpenguins::penguins %>% filter(!is.na(bill_length_mm))

Set seed

set.seed(23)

Perform split

penguin_split <- penguins %>% initial_split(prop = 0.80) penguins_train <- training(penguin_split) penguins_test <- testing(penguin_split)

Participants will run into error if null values in bill_length_mm are not dropped

leahhrlee avatar Oct 11 '23 22:10 leahhrlee

If not filtered, this error will occur: "Error in if (nulldev == 0) stop("y is constant; gaussian glmnet fails at standardization step") : missing value where TRUE/FALSE needed"

leahhrlee avatar Oct 11 '23 22:10 leahhrlee