二分类模型指标
- 混淆矩阵
TP(实际为正预测为正),FP(实际为负但预测为正),TN(实际为负预测为负),FN(实际为正但预测为负)
-
准确率
A c c u r a c y = T P + T N T P + F P + T N + F N Accuracy=\Large \frac{TP+TN}{TP+FP+TN+FN} Accuracy=TP+FP+TN+FNTP+TN -
查全率(召回率)和查准率
R e c a l l ( S e n s i t i v i t y ) = T P T P + T N Recall(Sensitivity)=\Large \frac{TP}{TP+TN} Recall(Sensitivity)=TP+TNTP
P r e c i s i o n = T P T P + F P Precision=\Large \frac{TP}{TP+FP} Precision=TP+FPTP
S p e c i f i c i t y = T N F P + T N Specificity=\Large \frac{TN}{FP+TN} Specificity=FP+TNTN -
F1度量—查准率和查全率的加权调和平均数
F 1 S c o r e = 1 1 / R e c a l l + 1 / P r e c i s i o n = 2 × R e c a l l × P r e c i s i o n R e c a l l + P r e c i s i o n F_{1}Score=\Large \frac{1}{1/Recall+1/Precision}=\Large \frac{2\times{Recall}\times{Precision}}{Recall+Precision} F1Score=1/Recall+1/Precision1=Recall+Precision2×Recall×Precision -
G度量–几何平均数
G = P r e c i s i o n × R e c a l l G=\sqrt[]{Precision\times{Recall}} G=Precision×Recall -
ROC曲线, AUC
ROC曲线描绘的是不同的截断点时,并以FPR(False Positive Rate)和TPR(True Positive Rate)为横纵坐标轴,描述随着截断点的变小,TPR随着FPR的变化。
纵轴: T P R = T P T P + F N = R e c a l l TPR=\Large \frac{TP}{TP+FN} \normalsize =Recall TPR=TP+FNTP=Recall
横轴: F P R = F P F P + T N FPR=\Large \frac{FP}{FP+TN} FPR=FP+TNFP
-
KS曲线,KS值
KS曲线和ROC曲线都用到了TPR,FPR。KS曲线是把TPR和FPR都作为纵坐标,而样本数作为横坐标。
TPR和FPR曲线分隔最开的位置就是最好的”截断点“,最大间隔距离就是KS值,通常>0.2即可认为模型有比较好偶的预测准确性 -
Lift 和Gain图
Lift图衡量的是,与不利用模型相比,模型的预测能力“变好”了多少,lift(提升指数)越大,模型的运行效果越好。
Gain图是描述整体精准度的指标。
G a i n = T P T P + F P Gain=\Large \frac{TP}{TP+FP} Gain=TP+FPTP
L i f t = T P T P + F P P P + N = G a i n P R Lift=\Large\frac{\frac{TP}{TP+FP}}{\frac{P}{P+N}}=\frac{Gain}{PR} Lift=P+NPTP+FPTP=PRGain
参考链接:https://blog.csdn.net/shy19890510/article/details/79501582