Notice
Recent Posts
Recent Comments
Today
Total
04-25 22:32
Archives
관리 메뉴

Jeongchul Kim

AUC(Area under an ROC curve)와 ROC 본문

MachineLearning

AUC(Area under an ROC curve)와 ROC

김 정출 2017. 10. 31. 00:24

AUC

AUC(Area under an ROC curve)

테스트의 정확도(Accuracy)를 평가하기 위해 두가지 지표를 사용한다. Sensitivity와 Specificity

- True Positive(Actual True - Prediction True) -> Sensitivity

- False Positive(Actual False - Prediction True) -> Specificity

- True Positive Rate = TP/P = TP / (TP+FN)

- False Positive Rate = FP/N = FP /(FP+TN)

- 이외의 변수에 대한 설명 참고(precision, recall, f1, mcc, ...)
- https://en.wikipedia.org/wiki/Sensitivity_and_specificity



이와 더불어 검사 방법의 판단을 위해 ROC(Receiver Operating Characteristic) Curve를 사용하는데

X축을 True Positive, Y축을 False Positive로 사용한다.


정확도는 ROC curve 아래의 면적(Area Under the ROC curve)에 측정될 수 있다.


다음의 그래프에서 보여지듯이 각 Graph에는 세 개의 ROC curves(Worthless, Good, Excellent)가 있다.

Accuracy(정확도)는 ROC Curve 아래 면적(area)로 측정된다.



- Area = 1인 경우 Test data-set에 대한 완벽한 정확도를 보인다.

- Area = 0.5인 경우 Test case에 부정확한(Worthless) 정확도이다.

- 0.9 ~ 1 = Excellent(A)

- 0.8 ~ 0.9 = Good(B)

- 0.7 ~ 0.8 = Fair(C)

- 0.6 ~ 0.7 = Poor(D)

- 0.5 ~ 0.6 = Fail(F)




Code in Python

scipy Library에 구현되어 있다.


from sklearn.metrics import roc_curve, auc

for i in range(n_classes):

 falsePostivie[i], truePositive[i], _ = roc_curve(y_label, y_predict) // label : 실제값, predict : 모델 예측값

 roc_auc[i] = auc(falsePostivie[i], truePositive[i]) // auc return ex 0.75


http://scikit-learn.org/stable/modules/generated/sklearn.metrics.roc_curve.html#sklearn.metrics.roc_curve

http://scikit-learn.org/stable/modules/generated/sklearn.metrics.auc.html#sklearn.metrics.auc


Reference

http://gim.unmc.edu/dxtests/roc3.htm

https://synapse.koreamed.org/pdf/10.4082/kjfm.2009.30.11.841

http://scikit-learn.org/stable/auto_examples/model_selection/plot_roc.html


'MachineLearning' 카테고리의 다른 글

01 Scala와 Scala IDE  (0) 2017.11.13
Bayesian Optimization  (2) 2017.10.31
SSD : Single Shot MultiBox Detector  (0) 2017.04.21
YOLO CNN : Real-Time Object Detection  (2) 2017.04.12
SparkNet : Training Deep Networks in Spark  (0) 2017.02.19
Comments