Last active
February 21, 2022 12:44
-
-
Save e96031413/fc7f8996056941b1ed73a5dce69c81c1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment