Main Content

Receiver operating characteristic

`[`

takes a matrix of targets and a matrix of outputs, and returns the true-positive/positive
ratios, the false-positive/negative ratios and the thresholds over interval
`tpr`

,`fpr`

,`thresholds`

] = roc(`targets`

,`outputs`

)`[0,1]`

.

For a single class problem, the function takes a matrix of boolean values indicating
class membership and a matrix of outputs values in the range `[0,1]`

.

The *receiver operating characteristic* is a metric used to check the
quality of classifiers. For each class of a classifier, `roc`

applies
threshold values across the interval `[0,1]`

to outputs. For each
threshold, two values are calculated, the True Positive Ratio (TPR) and the False Positive
Ratio (FPR). For a particular class *i*, TPR is the number of outputs whose
actual and predicted class is class *i*, divided by the number of outputs
whose predicted class is class *i*. FPR is the number of outputs whose
actual class is not class *i*, but predicted class is class
*i*, divided by the number of outputs whose predicted class is not class
*i*.

You can visualize the results of this function with `plotroc`

.