ComeçarComece de graça

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 exercício faz parte do curso

Machine Learning with caret in R

Ver curso

Instruções do exercício

Make a custom trainControl called myControl for classification using the trainControl function.

  • Use 10 CV folds.
  • Use twoClassSummary for the summaryFunction.
  • Be sure to set classProbs = TRUE.

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

# Create custom trainControl: myControl
myControl <- trainControl(
  method = "cv", 
  number = ___,
  summaryFunction = ___,
  classProbs = ___, # IMPORTANT!
  verboseIter = TRUE
)
Editar e executar o código