title: Plot ROC in R for a GLM model
body: <pre><code>pred1 &lt;- prediction(predictions=glm.prob2,labels = train_data)
  </code></pre>
  
  <blockquote>
    <p>error: Error in prediction(predictions = glm.prob2, labels = train_data) : 
      Number of predictions in each run must be equal to the number of labels for each run.</p>
  </blockquote>
  
  <p>I have used glm model to predict the output and trying to produce pred1 as a variable for plotting the ROC curve.</p>
  
  <p>Here is  the full code</p>
  
  <pre><code>View(train_data)
  library(ROCR)
  pred1 &lt;- prediction(predictions=glm.prob2,labels = train_data)
  perf1&lt;-performance(pred1,measure ="TP.rate",x.measure = "FP.rate")
  plot(perf1)
  </code></pre>