- As a low-code alternative, the Classification Learner app will produce ROC plots.
- As an alternative to perfcurve which was introduced in R2009a, rocmetrics https://www.mathworks.com/help/stats/rocmetrics.html was introduced in R2022a. rocmetrics produces an rocmetrics object which provides some additional funcitonality. The basic syntax is
- As seen in the basic rocmetrics syntax above, for each data observation, the necessary input includes the correct Label, the classifier Scores (for all classes), and the ClassNames. From what you have written, it is not clear if you have provided the classifer scores as input.
- How many unique output classes are there in the classification problem? Keep in mind that the ROC curve is different for each class. That is, an ROC curve can be constructed for each class, with that class treated as one-vs-all, that is, that one class versus all other classes. If you have a binary problem, you just need to pick which class to consider as the "positive" class. If you have a multiclass problem, you can look at the one-vs-all ROC curve for each class, or as an alternative, the rocmetrics object also provides an "average" method to "Compute performance metrics for average receiver operating characteristic (ROC) curve in multiclass problem", see https://www.mathworks.com/help/stats/rocmetrics.average.html