Neural Network Toolbox |
Postprocess the trained network response with a linear regression
Syntax
Description
postreg
postprocesses the network training set by performing a linear regression between each element of the network response and the corresponding target.
postreg(A,T)
takes these inputs,
A
-- 1
x Q
array of network outputs. One element of the network output
T
-- 1
x Q
array of targets. One element of the target vector
Examples
In this example we normalize a set of training data with prestd, perform a principal component transformation on the normalized data, create and train a network using the pca
data, simulate the network, unnormalize the output of the network using poststd, and perform a linear regression between the network outputs (unnormalized) and the targets to check the quality of the network training.
p = [-0.92 0.73 -0.47 0.74 0.29; -0.08 0.86 -0.67 -0.52 0.93]; t = [-0.08 3.4 -0.82 0.69 3.1]; [pn,meanp,stdp,tn,meant,stdt] = prestd(p,t); [ptrans,transMat] = prepca(pn,0.02); net = newff(minmax(ptrans),[5 1],{'tansig''purelin'},'trainlm'); net = train(net,ptrans,tn); an = sim(net,ptrans); a = poststd(an,meant,stdt); [m,b,r] = postreg(a,t);
Algorithm
Performs a linear regression between the network response and the target, and then computes the correlation coefficient (R
-value) between the network response and the target.
See Also
postmnmx | poststd |
© 1994-2005 The MathWorks, Inc.