Main Content

plotregression

(To be removed) Plot linear regression

plotregression will be removed in a future release. For more information, see Transition Legacy Neural Network Code to dlnetwork Workflows.

For advice on updating your code, see Version History.

Description

plotregression(targets,outputs) plots the linear regression of targets relative to outputs.

example

plotregression(targs1,outs1,'name1',targs2,outs2,'name2',...) generates multiple plots.

Examples

collapse all

This example shows how to plot the linear regression of a feedforward net.

[x,t] = simplefit_dataset;
net = feedforwardnet(10);
net = train(net,x,t);

Figure Neural Network Training (24-Jan-2026 18:15:08) contains an object of type uigridlayout.

y = net(x);
plotregression(t,y,'Regression')

Figure Regression (plotregression) contains an axes object. The axes object with title Regression: R=0.99999, xlabel Target, ylabel Output ~= 1*Target + -0.00095 contains 3 objects of type line. One or more of the lines displays its values using only markers These objects represent Y = T, Fit, Data.

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

expand all