Machine learning roc_auc与混淆矩阵

Machine learning roc_auc与混淆矩阵,machine-learning,classification,modeling,roc,auc,Machine Learning,Classification,Modeling,Roc,Auc,我正在使用Roc_auc分数测试不同的树与LightGBM。结果很奇怪 代码如下: ### Locate X and y in the dataset X = final_df.iloc[:,2:].values y = final_df.loc[:,'TARGET'].values ### Split X and y X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.3, random_state=

我正在使用Roc_auc分数测试不同的树与LightGBM。结果很奇怪

代码如下:

### Locate X and y in the dataset
X = final_df.iloc[:,2:].values
y = final_df.loc[:,'TARGET'].values

### Split X and y
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.3, random_state=0)

### Call algos
tree = DecisionTreeClassifier(criterion = 'entropy', random_state = 0 )
LGBM = LGBMClassifier()


### Train the model
tree.fit(X_train, y_train)
LGBM.fit(X_train, y_train)

使用上面的代码,我得到了LGBM和树的混淆矩阵,如下所示。到目前为止,一切看起来都很好

for model in [LGBM, tree]:
    
    model.fit(X_train, y_train)
    matrix = plot_confusion_matrix(model, X_test, y_test,
                             cmap=plt.cm.Blues,
                             normalize='true')
    plt.title('Confusion matrix for our classifier')
    plt.show(matrix)
    plt.show()

然后我想看看这两个人的Roc_auc分数,如下所示:

for model in [LGBM, tree]:
    y_predict = model.predict_proba(X_test) ### predict the probability
    y_prob = y_predict[:,1]
    auc = roc_auc_score(y_test, y_prob)
    print('{}: AUC score {}'.format(models_dict[model], auc))
LGBM: AUC score 0.982679224930189
Decision Tree: AUC score 0.8728317459710319
显示了以下内容:

for model in [LGBM, tree]:
    y_predict = model.predict_proba(X_test) ### predict the probability
    y_prob = y_predict[:,1]
    auc = roc_auc_score(y_test, y_prob)
    print('{}: AUC score {}'.format(models_dict[model], auc))
LGBM: AUC score 0.982679224930189
Decision Tree: AUC score 0.8728317459710319

我很困惑为什么AUC分数这么高。。。这是因为我的模型还是我的代码?请让我知道您的想法,谢谢。

我觉得这很正常,您能澄清错误吗?