R cv.glmnet()

1 개요[ | ]

R cv.glmnet()
  • "Cross-Validation For Glmnet → Glmnet용 교차-검증"
options(echo=T)
library(glmnet)

x = as.matrix(mtcars[, -1])
y = mtcars[,1]

set.seed(1234)
cv = cv.glmnet(x, y, alpha=0)
plot(cv)
# lambda.min(MSE 최소화 lamdba) = 2.746789
cv$lambda.min
# lambda.1se(MSE 최소화 lamdba + 1 표준편차) = 11.08883
cv$lambda.1se

2 같이 보기[ | ]

3 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}