title: Plot ROC curve for bootstrapped caret model
body: <p>I have a model like the following:</p>
  
  <pre><code>library(mlbench)
  data(Sonar)
  
  library(caret)
  set.seed(998)
  
  my_data &lt;- Sonar
  
  fitControl &lt;-
    trainControl(
      method = "boot632",
      number = 10,
      classProbs = T,
      savePredictions = T,
      summaryFunction = twoClassSummary
    )
  
  
  model &lt;- train(
    Class ~ .,
    data = my_data,
    method = "xgbTree",
    trControl = fitControl,
    metric = "ROC"
  )
  </code></pre>
  
  <p>How do I plot the ROC curve for this model? As I understand it, the probabilities must be saved (which I did in trainControl), but because of the random sampling which bootstrapping uses to generate a 'test' set, I am not sure how caret calculates the ROC value and how to generate a curve.</p>
  
  <p>To isolate the class probabilities for the best performing parameters, I am doing:</p>
  
  <pre><code>for (a in 1:length(model$bestTune))       
  {model$pred &lt;-
          model$pred[model$pred[, paste(colnames(model$bestTune)[a])] == model$bestTune[1, a], ]}
  </code></pre>
  
  <p>Please advise.</p>
  
  <p>Thanks!</p>