当前位置:网站首页>Common evaluation indexes of classification model -- confusion matrix and ROC curve

Common evaluation indexes of classification model -- confusion matrix and ROC curve

2022-06-26 14:22:00 Chaoying.

Confusion matrix

 Insert picture description here

Quantitative accuracy

  • Overall classification accuracy (Overall Accuracy)
    The number of samples with correct classification / The total number of samples
    OA=(e+f+g)/(a+b+c+d+e+f+g+h+i)
  • Kappa coefficient
    P0=OA
    Pe=∑( Real sample number × Number of classified samples )/ The total number of samples 2
    for example :Pe=[(a+b+c)×(a+d+g)+(b+e+h)×(d+e+f)+(g+h+i)×(c+f+i)] /(a+b+c+d+e+f+g+h+i)2
    Kappa=(P0-Pe )/(1-Pe)
  • User accuracy (User accuracy )
    From the perspective of prediction , The number of correctly predicted samples accounts for the total number of predicted samples in this category
    • Category 1user_accuracy=a/(a+d+g)
    • Category 2user_accuracy=e/(b+e+h)
    • Category 3user_accuracy=i/(c+f+i)
  • Producer’s accuracy (Producer accuracy)
    From the perspective of samples , The number of correctly predicted samples accounts for the total number of samples in this category
    • Category 1Prod.accuracy=a/(a+b+c)
    • Category 2Prod.accuracy=e/(d+e+f)
    • Category 3Prod.accuracy=i/(g+h+i)

ROC curve

roc The curve is mainly used to evaluate the accuracy of the binary classification model
 Insert picture description here
a:TP( True positive )
c:FP( False positive )
b:FN( False positive )
d:TN( True negative )

  • True inspection rate ( sensitivity , Hit rate )
    TPR=a/(a+b)
  • False detection rate ( Specificity , False alarm rate )
    FPR=c/(c+d)

ROC curve The horizontal axis of the coordinate is FPR, The vertical axis of the coordinate is TPR,ROC The curve does not describe FPR And TPR The functional relationship between
 Insert picture description here

ROC The curve does not describe FPR And TPR The functional relationship between ,FPR And TPR There is no functional relationship between ,FPR And TPR yes threshold τ Function of ,τ Describes the percentage of samples tested positive , When τ=0 when , All samples were identified as negative , here FPR( Specificity 、 False alarm rate 、 False detection rate ) by 0(FPR The smaller the better. ), but TPR( sensitivity 、 shooting 、 True inspection rate ) by 0(TPR The bigger the better ), When τ=1 All samples were identified as positive , here TPR=1,FPR=1. Therefore, it is necessary to select an appropriate τ Value makes TPR The bigger the better ,FPR The smaller the better. .

Area under curve (Area Under Curve,AUC)
AUC be equal to roc The area of the Encircled City along the horizontal axis of the curve and coordinate , yes roc Integral of the curve ,AUC The larger the number, the better

原网站

版权声明
本文为[Chaoying.]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202170508311281.html