title: caret - error - Something is wrong - all the ROC metric values are missing:
body: <p>i am using the caret package. At specific instances, as for example, but not exclusively per the example below, caret will produce the following error: </p>
  
  <pre><code>Something is wrong; all the ROC metric values are missing:
  Error in train.default(x, y, weights = w, ...) : Stopping
  </code></pre>
  
  <p>The strange thing is that caret might do this with nearly identical calls. E.g. - the first call per below works, the second call gives an error. i have had similar issue when i included e.g. the Verbose argument, keeping all things equal, or when i run specific packages in caret (e.g. SVMs). </p>
  
  <p>I have read that the issue might be definition of the class variable, but my main variable is a standard factor with 2 levels, e.g. (Factor w/ 2 levels "NP","P": 1 1 1 1 1 1 1 1 1 1 ...). </p>
  
  <p>Does anyone have any tips? </p>
  
  <p>(apologies for not including reproducible example)</p>
  
  <pre><code>Call 1
  gbmFit1 &lt;- train(class ~., data = dt_fulltrain,method = "gbm",metric="ROC",trControl = fitControl)
  
  Call2
  gbmFit1 &lt;- train(class ~., data = dt_fulltrain,method = "gbm",metric="ROC",trControl = fitControl, strata = dt_fulltrain$class, sampsize = rep(nmin, 2))
  </code></pre>