2
$\begingroup$

How can we create an ROC curve from an array of Confusion Matrices (true positive rates and false positive rates)?

$\endgroup$
1
  • $\begingroup$ Do the confusion matrices correspond to various thresholds for classification? $\endgroup$
    – Dave
    Jun 17 at 4:02
1
$\begingroup$

I will assume your confusion matrices correspond to classification thresholds.

For each confusion matrix, you use the number of predicted positive cases, number of predicted negative cases, number of true positive cases, and number of true negative cases to calculate the true positive rate (sensitivity) and false positive rate (1-specificity). Then you plot those values.

$\endgroup$
1
$\begingroup$

Let's say we have $N$ confusion-matrices for a binary classifier: $$C_{1}, C_{2}, ..., C_{N}$$ for corresponding classifier thresholds of monotonous sequences, $$t_{0} < t_{1} < ... < t_{N}$$ between 0 and 1.0, obtained on the fixed test set $D$. We can compute corresponding True Positive Rates $${\bf{TPR}} = [TPR_{1}, ..., TPR_{N}]$$ and False Positive Rates $${\bf{FPR}} = [FPR_{1}, ..., FPR_{N}]$$ from the confusion matrices.

The plot of $\bf{TPR}$ vs. $\bf{FPR}$ will give us the ROC curve. Ordering is not required but would be helpful in debugging any anomalies.

There is a great explanation of how thresholds are defined and ROC is plotted from Scientific American article Better DECISIONS through SCIENCE.

Please note that ROC is criticized heavily for not being easy to interpret, prone to class imbalance and famously not being a coherent measure, see h-measure. Interpreting the result of ROCAUC should be practiced with strong caution.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.