Receiver operating characteristic
[tpr,fpr,thresholds] = roc(targets,outputs)
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
.
[tpr,fpr,thresholds] = roc(targets,outputs)
takes these arguments:
targets |
|
outputs |
|
and returns these values:
tpr |
|
fpr |
|
thresholds |
|
roc(targets,outputs)
takes these arguments:
targets |
|
outputs |
|
and returns these values:
tpr |
|
fpr |
|
thresholds |
|
load iris_dataset net = patternnet(20); net = train(net,irisInputs,irisTargets); irisOutputs = sim(net,irisInputs); [tpr,fpr,thresholds] = roc(irisTargets,irisOutputs)