D-Lab's 6 hour introduction to machine learning in R. Learn the fundamentals of machine learning, regression, and classification, using tidymodels in R.
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"
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