Make a custom trainControl
The wine quality dataset was a regression problem, but now you are looking at a classification problem. This is a simulated dataset based on the "don't overfit" competition on Kaggle a number of years ago.
Classification problems are a little more complicated than regression problems because you have to provide a custom summaryFunction to the train() function to use the AUC metric to rank your models. Start by making a custom trainControl, as you did in the previous chapter. Be sure to set classProbs = TRUE, otherwise the twoClassSummary for summaryFunction will break.
Este ejercicio forma parte del curso
Machine Learning with caret in R
Instrucciones del ejercicio
Make a custom trainControl called myControl for classification using the trainControl function.
- Use 10 CV folds.
- Use
twoClassSummaryfor thesummaryFunction. - Be sure to set
classProbs = TRUE.
Ejercicio interactivo práctico
Prueba este ejercicio y completa el código de muestra.
# Create custom trainControl: myControl
myControl <- trainControl(
method = "cv",
number = ___,
summaryFunction = ___,
classProbs = ___, # IMPORTANT!
verboseIter = TRUE
)