title: Format of Prediction for ROCR curves in R
body: <p>It's my first time approaching ROCR curves in R, and using </p>
  
  <pre><code>#ROCR Curve
  library(ROCR)
  
  predict_rf &lt;- predict(Model_RF, type = 'response')
  
  ROCRpred_rf &lt;- prediction(predict_rf, test.5$si2014)
  ROCRperf_rf &lt;- performance(ROCRpred_rf, 'tpr','fpr')
  plot(ROCRperf_rf, colorize = TRUE, text.adj = c(train-0.2,1.7))
  </code></pre>
  
  <p>I got</p>
  
  <pre><code>&gt; #ROCR Curve
  &gt; library(ROCR)
  &gt; 
  &gt; predict_rf &lt;- predict(Model_RF, type = 'response')
  &gt; 
  &gt; ROCRpred_rf &lt;- prediction(predict_rf, test.5$si2014)
  Error in prediction(predict_rf, test.5$si2014) : 
    Format of predictions is invalid.
  </code></pre>
  
  <p>I'm using a RandomForest model to predict a factor variable (si2014).
  This is the dataset I used for my predictions.</p>
  
  <pre><code>&gt; sapply(test.5, class)
     spesa_tot     n_visite      importo        sesso eta_abbonati 
     "numeric"    "numeric"    "numeric"     "factor"    "numeric" 
        si2014     mesi_tot    Residenza      cluster 
     "numeric"    "integer"     "factor"     "factor" 
  </code></pre>
  
  <p>What's the problem? With SVM model I've no problems at all....</p>