AI 모델 평가 지표

PillowSophie·2026년 3월 23일
  • Classification
    • Accuracy
    • F1 Score - Precision & Recall
    • ROC-AUC
    • PR-AUC
    • Log Loss (Cross-Entropy Loss)
  • Regression
    • Mean Absolute Error (MAE) → L1
    • Mean Squared Error (MSE) → L2
    • MAPE
    • Theil's U
    • Peak Signal-to-Noise Ratio (PSNR)
    • R2 Score

Accuracy

Accuracy=TP+TNTP+TN+FP+FNAccuracy= \frac{TP+TN}{TP+TN+FP+FN}

모델이 정확하게 예측한 비율

단점

데이터 분포를 반영하지 못해 불균형 데이터에서 신뢰할 수 없음

F1 Score - Precision & Recall

Precision

양성 예측도, Must be real
허위 양성을 줄이는 것이 중요할 때
예시) 불량이지 않은 부품을 골라낼 때, 유죄라고 판단할 때

Precision=TPTP+FPPrecision = \frac{TP}{TP+FP}

Recall

재현율, Could be real
양성을 놓치지 않는 것이 중요할 때
예시) 병균 감식, 용의자를 선정할 때

Recall=TPTP+FNRecall = \frac{TP}{TP+FN}

F1 Score

Precision 과 Recall 의 균형 점수

F1=2PrecisionRecallPrecision+RecallF1=2⋅\frac{Precision⋅Recall}{Precision+Recall}

ROC-AUC

t 는 threshold

(x,y)=(FPR(t),TPR(t))(x,y)=(FPR(t),TPR(t))


[출처: ISLR (An Introduction to Statistical Learning), p.148]

PR-AUC

Precision - Recall curve

(x,y)=(Recall,Precision)(x,y)=(Recall,Precision)


[출처: Géron, Hands-On Machine Learning (2nd ed.), p.96]

MAPE

Mean Absolute Percentage Error

MAPE=100%nt=1nAtFtAt\text{MAPE} = \frac{100\%}{n} \sum_{t=1}^{n} \left| \frac{A_t - F_t}{A_t} \right|
  • nn: 전체 데이터 포인트의 개수
  • AtA_t: tt시점의 실제값 (Actual value)
  • FtF_t: tt시점의 예측값 (Forecast value)

단점

  • 절대적인 차이(오차 크기) 가 중요한 상황이면 사용 불가
  • 타겟값이 0일때 사용 불가

Theil's U

주로 시계열 예측 모델의 성능 평가 시 사용. 베이스 라인인 naive 모델을 이전 값과 현재 값을 같다고 예측하는 모델일 때 이보다 얼마나 더 나은지 측정하는 지표

U=i=1n1(y^i+1yi+1yi)2i=1n1(yi+1yiyi)2U = \sqrt{\frac{\sum_{i=1}^{n-1} \left( \frac{\hat{y}_{i+1} - y_{i+1}}{y_i} \right)^2}{\sum_{i=1}^{n-1} \left( \frac{y_{i+1} - y_i}{y_i} \right)^2}}

PSNR

Signal-to-Noise Ratio
Peak Signal-to-Noise Ratio : 이미지처럼 최대값이 명확한 데이터

SNR=SignalPowerNoisePowerSNR=\frac{Signal Power}{Noise Power}
PSNR=10log10(maxvalue2MSE)PSNR=10log_{10}(\frac{max\,value^2}{MSE})

R2 Score

데이터 변동성 대비 모델이 설명한 비율

yiy_i: 타겟 값
y^i\hat{y}_i: 모델의 예측값
yˉ\bar{y}: 타겟의 평균 값

R2=1(yiy^i)2(yiyˉ)2R^2 = 1 - \frac{\sum (y_i - \hat{y}_i)^2}{\sum (y_i - \bar{y})^2}

0개의 댓글