Skip to content

Instantly share code, notes, and snippets.

@saihttam
saihttam / gist:7241db5be80d076c1e8f
Created September 27, 2015 16:45 — forked from anonymous/gist:1c6198cd663165d2dd53
Plot ROC Curve with Cut-Off Markers
def plot_roc(y, probs, threshmarkers=None):
fpr, tpr, thresh = sklearn.metrics.roc_curve(y, probs)
plt.plot(fpr, tpr, lw=2)
if threshmarkers is None:
threshmarkers = np.linspace(0, 1, 11)
for t in threshmarkers:
k = np.abs(thresh-t).argmin()
x = fpr[k]
y = tpr[k]