How to interpret this triangular shape ROC AUC curve?

放肆的年华 提交于 2019-12-04 18:55:49

You're doing it wrong. According to documentation:

y_score : array, shape = [n_samples]

    Target scores, can either be probability estimates of the positive class or confidence values.

Thus at this line:

roc_curve(y_test, y_test_predictions)

You should pass into roc_curve function result of decision_function (or some of two columns from predict_proba result) instead of actual predictions.

Look at these examples http://scikit-learn.org/stable/auto_examples/model_selection/plot_roc.html#example-model-selection-plot-roc-py

http://scikit-learn.org/stable/auto_examples/model_selection/plot_roc_crossval.html#example-model-selection-plot-roc-crossval-py

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