C.W.K.
Stream
Lesson 03 of 04 · published

ROC-AUC vs PR-AUC

~28 min · metrics, roc, pr-auc

Level 0Scout
0 XP0/48 lessons0/11 achievements
0/120 XP to next level120 XP to go0% complete

두 threshold-free 요약

ROC-AUC가 모든 threshold에서 모델이 negative 위에 positive를 얼마나 잘 ordering 하는지 통합. PR-AUC(average precision)가 precision/recall curve 요약. 둘 다 threshold 무시, 둘 다 label이 아니라 score에 의존.

어느 걸 언제

class 대략 balanced이고 run 사이 단일 비교 숫자 원하면 ROC-AUC. positive class가 rare하면 PR-AUC, 모델이 positive를 거의 못 잡아도 ROC-AUC는 deceptively 높게 유지될 수 있어. fraud, churn, anomaly detection엔 PR-AUC가 거의 항상 옳은 선택.

0.5 신화

ROC-AUC 0.5는 random ordering보다 안 낫다. PR-AUC의 random baseline은 positive class 유병률 — user 1%가 churn 하면 random PR-AUC는 0.5가 아니라 0.01. PR-AUC는 항상 prevalence와 함께 보고.

Code

두 AUC 나란히·python
from sklearn.metrics import roc_auc_score, average_precision_score

roc = roc_auc_score(y_val, probs)
pr = average_precision_score(y_val, probs)
prevalence = y_val.mean()
print(f"ROC-AUC={roc:.3f}  PR-AUC={pr:.3f}  prevalence={prevalence:.3f}")
모델이 깨지는 곳 보는 PR curve plot·python
from sklearn.metrics import PrecisionRecallDisplay
import matplotlib.pyplot as plt

PrecisionRecallDisplay.from_predictions(y_val, probs)
plt.title("Validation precision-recall curve")
plt.grid(True)
plt.show()

External links

Exercise

classifier에서 ROC-AUC, PR-AUC, positive-class prevalence를 한 줄로 계산하고 보고. 팀이 default로 ROC-AUC 쓰고 positive class가 rare면, PR-AUC로 전환을 두 문장으로 제안.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.