Plot multiple ROC from multiple column values
<p>Assuming I have retrieved 3 arrays from 3 columns in a <code>csv</code> file which are:</p>

<pre><code>y1=['1', '0', '0', '0', '1'];
y2=['1', '1', '1', '0', '0'];
y3=['0', '1', '1', '0', '1'];
</code></pre>

<p>How can I plot 2 ROCs such that <code>y1</code> vs <code>y2</code> and <code>y1</code> vs <code>y3</code> (in sklearn)? </p>

<p>Assuming y1 is your label and y2 and y3 are your scores below code should do it:</p>

<pre><code>y1=[1, 0, 0, 0, 1];
y2=[1, 1, 0, 0, 1];
y3=[0, 0, 1, 0, 1];
from sklearn.metrics import *
import pandas as pd
import matplotlib.pyplot as plt

plt.figure(figsize=(14,10),dpi=640)
fpr, tpr, thresholds = roc_curve(y1, y2)
auc1 = auc(fpr,tpr)

plt.plot(fpr, tpr,label="AUC Y2:{0}".format(auc1),color='red', linewidth=2)

fpr, tpr, thresholds = roc_curve(y1, y3)
auc1 = auc(fpr,tpr)

plt.plot(fpr, tpr,label="AUC Y3:{0}".format(auc1),color='blue', linewidth=2)

plt.plot([0, 1], [0, 1], 'k--', lw=1) 
plt.xlim([0.0, 1.0]) 
plt.ylim([0.0, 1.05])

plt.xlabel('False Positive Rate')  
plt.ylabel('True Positive Rate') 
plt.title('ROC') 
plt.grid(True)
plt.legend(loc="lower right")
plt.show()
</code></pre>

python scikit-learn multiple-columns roc