如何在同一張圖上繪製多條ROC曲線?

mean_tpr /= 4
mean_tpr[-1] = 1.0
std_auc = np.std(aucs) # std
mean_auc = auc(mean_fpr, mean_tpr) # mean auc
import numpy as np
from sklearn import metrics
from sklearn.metrics import roc_auc_score
y = np.array([1, 1, 2, 2])#scores可以是模型預測結果(Label)
#scores也可以是模型預測的confidence(softmax probability)
scores = np.array([1, 1, 2, 2])
scores = np.array([0.1, 0.4, 0.35, 0.8])
area_under_curve = roc_auc_score(y, scores)

--

--

--

Machine Learning | Deep Learning | https://linktr.ee/yanwei

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Yanwei Liu

Yanwei Liu

Machine Learning | Deep Learning | https://linktr.ee/yanwei

More from Medium

What is Algorithmic Bias?

Convolutional neural networks’ Glossary

Understand matplotlib pyplot in minutes

What is an RNN?