postreg
Purpose
Postprocess trained network response with 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)
|
and returns
M
|
Slope of the linear regression
|
B
|
Y intercept of the linear regression
|
R
|
Regression R-value (R = 1 means perfect correlation)
|
Examples
In this example you normalize a set of training data with mapstd, 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 mapstd, 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,ps1] = mapstd(p);
[ptrans,ps2] = processpca(pn,0.02);
[tn,ts] = mapstd(t);
net = newff(minmax(ptrans),[5 1],{'tansig''purelin'},'trainlm');
net = train(net,ptrans,tn);
an = sim(net,ptrans);
a = mapstd(`reverse',an,ts);
[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
mapminmax, mapstd, processpca
| | Provide feedback about this page |
 | poslin | | processpca |  |
Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
Get the Interactive Kit