问题
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