Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- glmnGrid <- expand.grid(alpha = c(0, .1, .2, .4, .6, .8, 1),
- lambda = seq(.01, .2, length = 40))
- ctrl <- trainControl(method = "cv",
- number = 10,
- summaryFunction = twoClassSummary,
- classProbs = TRUE,
- index = list(TrainSet = pre2008),
- savePredictions = TRUE)
- glmnFit <- train(x = training[,fullSet],
- y = training$Class,
- method = "glmnet",
- tuneGrid = glmnGrid,
- preProc = c("center", "scale"),
- metric = "ROC",
- trControl = ctrl)
- glmnetCM <- confusionMatrix(glmnFit, norm = "none")
- Reference
- Prediction successful unsuccessful
- successful 507 208
- unsuccessful 63 779
- > dim(training)
- [1] 8190 1785
- > length(pre2008)
- [1] 6633
- > 8190-6633
- [1] 1557
- ctrl <- trainControl(method = "LGOCV",
- summaryFunction = twoClassSummary,
- classProbs = TRUE,
- index = list(TrainSet = pre2008))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement