title: Caret "Error in train.default(x, y, weights = w, ...) : final tuning parameters could not be determined" when optimizing for ROC
body: <p>I'm trying to create a binary classifier, modelling with <code>caret</code> to optimize ROC. The method I was attempting was <code>C5.0</code> and I get the following error and warning:</p>
  
  <pre><code>Error in train.default(x, y, weights = w, ...) : 
    final tuning parameters could not be determined
  In addition: Warning messages:
  1: In nominalTrainWorkflow(x = x, y = y, wts = weights, info = trainInfo,  :
    There were missing values in resampled performance measures.
  2: In train.default(x, y, weights = w, ...) :
    missing values found in aggregated results
  </code></pre>
  
  <p>I had modelled the same training data with <code>C5.0</code> and <code>caret</code> earlier but optimizing for Accuracy and not using twoClassSummary in the control, and it ran without error. </p>
  
  <p>My tuning grid and control for ROC run were</p>
  
  <pre><code>c50Grid &lt;- expand.grid(.trials = c(1:9, (1:10)*10),
                         .model = c("tree", "rules"),
                         .winnow = c(TRUE, FALSE))
  
  fitTwoClass &lt;- trainControl(
    method = "repeatedcv",
    number = 5,
    repeats = 5,
    classProbs=TRUE,
    summaryFunction = twoClassSummary
    )
  </code></pre>
  
  <p>During Accuracy run, I omitted <code>classProbs</code> and <code>summaryFunction</code> portion of the control.</p>
  
  <p>For the modeling, the command was</p>
  
  <pre><code>fitModel &lt;- train(
    Unhappiness ~ .,
    data = dnumTrain,
    tuneGrid=c50Grid,
    method = "C5.0",
    trControl = fitTwoClass,
    tuneLength = 5,
    metric= "ROC"
    )
  </code></pre>
  
  <p>Can anyone advise how to troubleshoot this? Not sure what parameter to be tweaked if any to make this work, while I believe the dataset should be OK (since it ran OK when optimizing for Accuracy).</p>
  
  <p>To reproduce, training set <code>dnumTrain</code> can be <code>load</code>ed from the file in <a href="https://dl.dropboxusercontent.com/u/5548442/StackOverflow%20attachments/dnumtrain.RData" rel="nofollow">this link</a>.</p>