Skip to content

Instantly share code, notes, and snippets.

View kaiwang0112006's full-sized avatar

kaiwang kaiwang0112006

  • Beijing
View GitHub Profile
@Keiku
Keiku / roc_auc.py
Last active October 5, 2022 01:52
Plot ROC curve.
import matplotlib.pyplot as plt
from sklearn.metrics import roc_curve, auc
import seaborn as sns
sns.set('talk', 'whitegrid', 'dark', font_scale=1.5, font='Ricty',
rc={"lines.linewidth": 2, 'grid.linestyle': '--'})
fpr, tpr, _ = roc_curve([1, 0, 1, 0, 1, 0, 0], [0.9, 0.8, 0.7, 0.7, 0.6, 0.5, 0.4])
roc_auc = auc(fpr, tpr)