ROC 곡선과 AUC 출력
3040 단어 파이썬scikit-learn로지스틱 회귀기계 학습
파이썬으로 ROC 곡선을 그려 보았습니다.
전제
코드
roc.py
from sklearn import metrics
import matplotlib.pyplot as plt
import numpy as np
# FPR, TPR(, しきい値) を算出
fpr, tpr, thresholds = metrics.roc_curve(test_y, predict_y)
# ついでにAUCも
auc = metrics.auc(fpr, tpr)
# ROC曲線をプロット
plt.plot(fpr, tpr, label='ROC curve (area = %.2f)'%auc)
plt.legend()
plt.title('ROC curve')
plt.xlabel('False Positive Rate')
plt.ylabel('True Positive Rate')
plt.grid(True)

참고
ROC 곡선과 AUC에 대해서는 이쪽을 참고로.
【통계학】 ROC 곡선이란 무엇인가, 애니메이션으로 이해한다.
【ROC 곡선과 AUC】기계 학습의 평가 지표에 대한 기초 강좌
Reference
이 문제에 관하여(ROC 곡선과 AUC 출력), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/9pid/items/53946c3ec4b2489e7cb2텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)