Computer Science/AI·ML·DL

[용어 설명] ROC curve와 AUC란?

2021. 8. 4. 18:19

  ROC (Receiver Operating Characteristic) curve FPR (False positive rate) TPR (True Positive Rate)을 각각 x, y축으로 놓은 그래프이다. TPR과 FPR은 다음과 같이 정의된다.

  • TPR (True Positive Rate): 1인 케이스에 대해 1로 바르게 예측하는 비율 (Sensitivity), 암 환자에 대해 암이라고 진단
  • FPR (False positive rate): 0인 케이스에 대해 1로 틀리게 예측하는 비율 (1-Specificity), 정상에 대해 암이라고 진단

 

  이때 Sensitivity와 Specificity는 반비례한다 (Sensitivity와 1-Specificity는 비례).

  • 모든 사람을 암이라고 진단: Sensitivity=1, Specificity=0 (TPR=1, FPR=1)
  • 모든 사람을 정상이라고 진단: Sensitivity=0, Specificity=1 (TPR=0, FPR=0)

 

  ROC curve는 모델의 판단 기준을 연속적으로 바꾸면서 측정했을 때 FPR TPR의 변화를 나타낸 것으로, (0,0)(1,1)을 잇는 곡선이다.

https://en.wikipedia.org/wiki/Receiver_operating_characteristic#/media/File:Roc-draft-xkcd-style.svg

  ROC curve는 어떤 모델(classifier)이 좋은 성능을 보이는지 판단할 때 사용할 수 있다. 즉, 높은 sensitivity와 높은 specificity를 보이는 모델을 고르기 위해 다양한 모델에 대해 ROC curve를 그려본다. 이때 좌상단으로 가장 많이 치우친 그래프를 갖는 모델이 가장 높은 성능을 보인다고 할 수 있다.

  이때 AUC (Area Under the ROC Curve)ROC curve의 밑면적을 말한다. 즉, 성능 평가에 있어서 수치적인 기준이 될 수 있는 값으로, 1에 가까울수록 그래프가 좌상단에 근접하게 되므로 좋은 모델이라고 할 수 있다.

 

 

  추가적으로 ROC curve와 AUC에 대한 아래 글을 참고할 수 있다. 그림 자료와 함께 이해하기 쉽게 쓴 글이었다.

https://towardsdatascience.com/understanding-the-roc-curve-in-three-visual-steps-795b1399481c

 

Understanding the ROC curve in three visual steps

One of the metrics that took me longer to understand in Data Science was the Receiver Operating Characteristic (ROC) curve. This is a…

towardsdatascience.com

 

728x90
반응형