R의 caret로 배우는 Machine Learning
Zach Mayer
Data Scientist at DataRobot and co-author of caret
alpha [0, 1]: 순수 릿지 → 순수 라쏘lambda (0, infinity): 패널티 크기# Load data
overfit <- read.csv("overfit.csv")
# Make a custom trainControl
myControl <- trainControl(
method = "cv",
number = 10,
summaryFunction = twoClassSummary,
classProbs = TRUE, # <- Super important!
verboseIter = TRUE
)
# Fit a model
set.seed(42)
model <- train(
y ~ .,
overfit,
method = "glmnet",
trControl = myControl
)
# Plot results
plot(model)
alpha 3개 값lambda 3개 값
R의 caret로 배우는 Machine Learning