首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >当AUC分数相似时,如何在模型之间进行选择?

当AUC分数相似时,如何在模型之间进行选择?
EN

Data Science用户
提问于 2019-03-15 12:18:44
回答 3查看 284关注 0票数 2

我使用了两种机器学习算法来进行二进制分类,并得到了以下结果:

Algo 1:

代码语言:javascript
复制
 AUC- Train : 0.75      AUC- Test: 0.65          big Train / overfitting

Algo 2:

代码语言:javascript
复制
 AUC- Train : 0.72      AUC- Test: 0.65          small train / small overfitting

哪一个更好?

EN

回答 3

Data Science用户

发布于 2019-03-15 12:36:02

根据AUC的分数,他们是一样的。模型是否过份合适并不重要。重要的是它在新数据(测试分数)上的表现如何。

过度安装只是一个迹象,可能会有改进的空间,使您的模式更加通用。但是,在测试分数增加之前,即使模型的拟合度过低,模型也没有得到改进。

票数 1
EN

Data Science用户

发布于 2019-03-15 13:31:33

Algo 2

在相同的测试成绩之间,选择训练成绩与测试成绩相差较小的(Algo 2),因为训练成绩较好的(Algo 1)更适合。只有当模型的主观测试分数更好时,我们才能容忍更适合的模型。

为了一个更好的理由,想想我们如何训练一个神经网络。当验证分数停止提高时,即使训练分数不断提高,我们也停止了训练过程。如果我们让培训继续下去,模型将开始根据没有被评论家仔细检查的培训集(验证集)做出额外的假设,这使得模型更容易建立关于数据的错误假设。

同样,基于评论家(测试集)具有相同性能但在训练集上表现更好的模型(Algo 1)很容易对数据做出未经测试的假设。

票数 1
EN

Data Science用户

发布于 2019-03-15 14:11:51

基于这个度量,您无法找到哪一个更好,因为AUC无法区分这两个结果。您应该使用其他一些指标,如Kappa或一些基准测试。

免责声明:

如果您正在使用Python,我建议使用PyCM模块,它将您的混淆矩阵作为输入,并计算大约100个总体和基于类的度量。

为了首先使用这个模块,准备您的混淆矩阵,并通过以下代码查看推荐的参数:

代码语言:javascript
复制
>>> from pycm import *

>>> cm = ConfusionMatrix(matrix={"0": {"0": 1, "1":0, "2": 0}, "1": {"0": 0, "1": 1, "2": 2}, "2": {"0": 0, "1": 1, "2": 0}})  

>>> print(cm.recommended_list)
["Kappa", "SOA1(Landis & Koch)", "SOA2(Fleiss)", "SOA3(Altman)", "SOA4(Cicchetti)", "CEN", "MCEN", "MCC", "J", "Overall J", "Overall MCC", "Overall CEN", "Overall MCEN", "AUC", "AUCI", "G", "DP", "DPI", "GI"]

然后,通过以下代码查看集中于推荐指标的指标的值:

代码语言:javascript
复制
>>> print(cm)
    Predict          0        1        2        
    Actual
    0                1        0        0        
    1                0        1        2        
    2                0        1        0        




Overall Statistics : 

95% CI                                                           (-0.02941,0.82941)
Bennett_S                                                        0.1
Chi-Squared                                                      6.66667
Chi-Squared DF                                                   4
Conditional Entropy                                              0.55098
Cramer_V                                                         0.8165
Cross Entropy                                                    1.52193
Gwet_AC1                                                         0.13043
Joint Entropy                                                    1.92193
KL Divergence                                                    0.15098
Kappa                                                            0.0625
Kappa 95% CI                                                     (-0.60846,0.73346)
Kappa No Prevalence                                              -0.2
Kappa Standard Error                                             0.34233
Kappa Unbiased                                                   0.03226
Lambda A                                                         0.5
Lambda B                                                         0.66667
Mutual Information                                               0.97095
Overall_ACC                                                      0.4
Overall_RACC                                                     0.36
Overall_RACCU                                                    0.38
PPV_Macro                                                        0.5
PPV_Micro                                                        0.4
Phi-Squared                                                      1.33333
Reference Entropy                                                1.37095
Response Entropy                                                 1.52193
Scott_PI                                                         0.03226
Standard Error                                                   0.21909
Strength_Of_Agreement(Altman)                                    Poor
Strength_Of_Agreement(Cicchetti)                                 Poor
Strength_Of_Agreement(Fleiss)                                    Poor
Strength_Of_Agreement(Landis and Koch)                           Slight
TPR_Macro                                                        0.44444
TPR_Micro                                                        0.4

Class Statistics :

Classes                                                          0                       1                       2                       
ACC(Accuracy)                                                    1.0                     0.4                     0.4                     
BM(Informedness or bookmaker informedness)                       1.0                     -0.16667                -0.5                    
DOR(Diagnostic odds ratio)                                       None                    0.5                     0.0                     
ERR(Error rate)                                                  0.0                     0.6                     0.6                     
F0.5(F0.5 score)                                                 1.0                     0.45455                 0.0                     
F1(F1 score - harmonic mean of precision and sensitivity)        1.0                     0.4                     0.0                     
F2(F2 score)                                                     1.0                     0.35714                 0.0                     
FDR(False discovery rate)                                        0.0                     0.5                     1.0                     
FN(False negative/miss/type 2 error)                             0                       2                       1                       
FNR(Miss rate or false negative rate)                            0.0                     0.66667                 1.0                     
FOR(False omission rate)                                         0.0                     0.66667                 0.33333                 
FP(False positive/type 1 error/false alarm)                      0                       1                       2                       
FPR(Fall-out or false positive rate)                             0.0                     0.5                     0.5                     
G(G-measure geometric mean of precision and sensitivity)         1.0                     0.40825                 0.0                     
LR+(Positive likelihood ratio)                                   None                    0.66667                 0.0                     
LR-(Negative likelihood ratio)                                   0.0                     1.33333                 2.0                     
MCC(Matthews correlation coefficient)                            1.0                     -0.16667                -0.40825                
MK(Markedness)                                                   1.0                     -0.16667                -0.33333                
N(Condition negative)                                            4                       2                       4                       
NPV(Negative predictive value)                                   1.0                     0.33333                 0.66667                 
P(Condition positive)                                            1                       3                       1                       
POP(Population)                                                  5                       5                       5                       
PPV(Precision or positive predictive value)                      1.0                     0.5                     0.0                     
PRE(Prevalence)                                                  0.2                     0.6                     0.2                     
RACC(Random accuracy)                                            0.04                    0.24                    0.08                    
RACCU(Random accuracy unbiased)                                  0.04                    0.25                    0.09                    
TN(True negative/correct rejection)                              4                       1                       2                       
TNR(Specificity or true negative rate)                           1.0                     0.5                     0.5                     
TON(Test outcome negative)                                       4                       3                       3                       
TOP(Test outcome positive)                                       1                       2                       2                       
TP(True positive/hit)                                            1                       1                       0                       
TPR(Sensitivity, recall, hit rate, or true positive rate)        1.0                     0.33333                 0.0
票数 1
EN
页面原文内容由Data Science提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://datascience.stackexchange.com/questions/47339

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档