Don't know about R, but for Python your data format would be correct. Two columns are needed for AUC calculation at a time (c vs tool1
).
https://scikit-learn.org/stable/auto_examples/model_selection/plot_roc.html
Assuming your table is saved in roc.csv
, here is a simple script:
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.metrics import RocCurveDisplay
df = pd.read_csv('roc.csv')
fig, ax = plt.subplots(figsize=(6, 6))
RocCurveDisplay.from_predictions(df['c'].values,df['tool1'].values,name='Tool1',pos_label=1,ax=ax,color='aqua')
RocCurveDisplay.from_predictions(df['c'].values,df['tool2'].values,name='Tool2',pos_label=1,ax=ax,color='darkorange')
RocCurveDisplay.from_predictions(df['c'].values,df['tool3'].values,name='Tool3',pos_label=1,ax=ax,color='cornflowerblue')
_ = ax.set(
xlabel='False Positive Rate',
ylabel='True Positive Rate',
title='AUC for various tools',
)
plt.savefig('multiple_auc_plots.png',dpi=150)
plt.show()
These should be pretty straightforward using the
R
libraryggplot2
. R Graph Gallery website is pretty good at giving templates and examples of most plot types with baseR
andggplot2
.If you want to calculate and visualize ROC Curves Across Multi-Class Classifications, you can use multiROC.