Main Content

plotroc

Plot receiver operating characteristic

Description

plotroc(targets,outputs) plots the receiver operating characteristic for each output class. The more each curve hugs the left and top edges of the plot, the better the classification.

Tip

plotroc does not support categorical targets. To plot ROC metrics for categorical targets, use rocmetrics.

example

plotroc(targets1,outputs2,'name1',...) generates multiple plots.

Examples

collapse all

This example shows how to plot the receiver operating characteristic for each output class in a pattern network.

load simplecluster_dataset
net = patternnet(20);
net = train(net,simpleclusterInputs,simpleclusterTargets);

Figure Neural Network Training (05-Sep-2024 18:40:07) contains an object of type uigridlayout.

simpleclusterOutputs = sim(net,simpleclusterInputs);
plotroc(simpleclusterTargets,simpleclusterOutputs)

Figure Receiver Operating Characteristic (plotroc) contains an axes object. The axes object with title ROC, xlabel False Positive Rate, ylabel True Positive Rate contains 8 objects of type line. These objects represent Class 1, Class 2, Class 3, Class 4.

Input Arguments

collapse all

Network targets, specified as a matrix or cell array.

Network outputs, specified as a matrix or cell array.

Version History

Introduced in R2008a

See Also