Why the auc is so different from logistic regression of sklearn and R

这一生的挚爱 提交于 2019-12-06 02:58:37

In the python script, you should use predict_proba to get the probability estimates for both classes and take the second column for the positive class as the input for roc_auc_score because ROC curve is plotted by varying the probability thresholds.

pred_logistic = model_logistic.predict_proba(test_x)[:,1]
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!