Draw ROC curve in python using confusion matrix only

荒凉一梦 提交于 2019-12-13 15:37:12

问题


I need to draw ROC curve using confusion matrix only. Actually my system was crashed ( every information was lost), therefore I am not getting data. I have only values of confusion matrix. I know how to create ROC curve (http://scikit-learn.org/stable/auto_examples/model_selection/plot_roc_crossval.html), but not getting any clue how to draw from confusion matrix. Please help me in this regards.


回答1:


Unfortunately you can't build a ROC curve from a single contingency matrix.

A ROC curve shows how the sensitivity and specificity vary as you change the decision threshold. In order to do that, it is necessary to calculate these values at all possible thresholds (at least those where the values step).

A contingency matrix reports the performance of one specific threshold. You can calculate sensitivity and specificity from it, but for a single threshold only. The information regarding the other thresholds has been lost, and therefore you cannot build the ROC curve.



来源:https://stackoverflow.com/questions/38560815/draw-roc-curve-in-python-using-confusion-matrix-only

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