title: How to plot a ROC curve for a knn model
body: <p>I am using ROCR package and i was wondering how can one plot a ROC curve for knn model in R? Is there any way to plot it all with this package?</p>
  
  <p>I don't know how to use the prediction function of ROCR for knn. Here's my example, i am using isolet dataset from UCI repository where i renamed the class attribute as y: </p>
  
  <pre><code>cl&lt;-factor(isolet_training$y)
  knn_isolet&lt;-knn(isolet_training, isolet_testing, cl, k=2, prob=TRUE)
  </code></pre>
  
  <p>Now my question is, what are the arguments to pass to the prediction function of ROC. I tried the 2 below alternatives which are not working:</p>
  
  <pre><code>library(ROCR)
  pred_knn&lt;-prediction(knn_isolet$y, cl)
  pred_knn&lt;-prediction(knn_isolet$y, isolet_testing$y)
  </code></pre>