小编Mor*_*eno的帖子

Excel VBA中的=和=之间有什么区别?

我已经使用Excel一段时间了,但我从来没有读过这两个操作符之间的区别("不管我用过两者") :==Excel VBA

excel vba excel-vba colon-equals

7
推荐指数
1
解决办法
1万
查看次数

校准会提高 roc 分数吗?

我正在研究执行校准分类器的效果,我读到校准的目的是使分类器的预测更“可靠”。考虑到这一点,我认为校准后的分类器会有更高的分数 (roc_auc)

当用 sklearn 在 Python 中测试这个假设时,发现正好相反

你能解释一下吗:

校准会提高 roc 分数吗?(或任何指标)

如果不是真的。执行校准的优势是什么?

clf=SVC(probability=True).fit(X_train,y_train)
calibrated=CalibratedClassifierCV(clf,cv=5,method='sigmoid').fit(X_train,y_train)
probs=clf.predict_proba(X_test)[:,1]
cal_probs=calibrated.predict_proba(X_test)[:,1]

plt.figure(figsize=(12,7))
names=['non-calibrated SVM','calibrated SVM']
for i,p in enumerate([probs,cal_probs]):
    plt.subplot(1,2,i+1)
    fpr,tpr,threshold=roc_curve(y_test,p)
    plt.plot(fpr,tpr,label=nombre[i],marker='o')
    plt.title(names[i]+ '\n' + 'ROC: '+ str(round(roc_auc_score(y_test,p),4)))
    plt.plot([0,1],[0,1],color='red',linestyle='--')
    plt.grid()
    plt.tight_layout()
    plt.xlim([0,1])
    plt.ylim([0,1])
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

python classification machine-learning roc scikit-learn

1
推荐指数
1
解决办法
882
查看次数