title: ROC curve error in randomForest
body: <p>I am trying to create a ROC curve off the below. I get an error that states Error in prediction(bc_rf_predict_prob, bc_test$Class) : 
    Number of cross-validation runs must be equal for predictions and labels.</p>
  
  <pre><code>library(mlbench) #has the Breast Cancer dataset in it
  library(caret)
  data(BreastCancer) #two class model
  
  bc_changed&lt;-BreastCancer[2:11] #removes variables not to be used
  
  
  #Create train and test/holdout samples (works fine)
  set.seed(59)
  bc_rand &lt;- bc_changed[order(runif(699)), ] #699 observations
  bc_rand &lt;- sample(1:699, 499) 
  bc_train &lt;- bc_changed[ bc_rand,]
  bc_test  &lt;- bc_changed[-bc_rand,]
  
  #random forest decision tree (works fine)
  library(caret)
  library(randomForest)
  set.seed(59) 
  bc_rf &lt;- randomForest(Class ~.,data=bc_train, ntree=500,na.action = na.omit, importance=TRUE)
  
  #ROC
  library(ROCR)
  actual &lt;- bc_test$Class 
  bc_rf_predict_prob&lt;-predict(bc_rf, type="prob", bc_test) 
  bc.pred = prediction(bc_rf_predict_prob,bc_test$Class) #not work- error
  </code></pre>
  
  <p>Error-Error in prediction(bc_rf_predict_prob, bc_test$Class) : 
    Number of cross-validation runs must be equal for predictions and labels.</p>
  
  <p>I think it is coming from the fact when I do the:</p>
  
  <pre><code>bc_rf_predict_prob&lt;-predict(bc_rf, type="prob", bc_test) 
  </code></pre>
  
  <p>I get a matrix as the result with two columns Benign and a list of its probabilities and a second column of Malignant and its list of probabilities. My logic tells me I should only have a vector of probabilities. </p>