Statistics, Data Science, Analytics, Business Intelligence, Machine Learning.
iris) y <- iris$Sepal.Length set.seed(123) train <- sample(1:nrow(X), floor(nrow(X) * 2/3)) model_cv <- cv.glmnet(X[train,], y[train]) plot(model_cv) model_1se <- glmnet( X[train,], y[train], lambda = model_cv$lambda.1se ) model_min <- glmnet( X[train,], y[train], lambda = model_cv$lambda.min ) mse