Matlab 神经网数据预处理的函数

1 std mean

std标准偏差。

对于向量,Y = std(X)返回标准偏差。对于矩阵,

Y是包含每列的标准偏差的行向量。对于

N-D数组,std沿着X的第一个非单实例维度运行。

std通过(N-1)归一化Y,其中N是样本大小。这是

sqrt的人口方差的无偏估计

只要X由独立的,相同的X构成

分发样品。

Y = std(X,1)用N归一化并产生第二个的平方根

关于其平均值的样本时刻。 std(X,0)与std(X)相同。

Y = std(X,FLAG,DIM)沿尺寸取标准偏差

DIM的X.传入FLAG == 0以使用N-1或者默认标准化

1使用N.

例如:如果X = [4 -2 1

9 5 7]

那么std(X,0,1)是[3.5355 4.9497 4.2426],std(X,0,2)是[3.0

2.0]

意思是平均值或平均值。

对于向量,平均值(X)是X中元素的平均值

矩阵,平均值(X)是包含平均值的行向量

每列。 对于N维数组,平均值(X)是平均值

沿着X的第一个非单实体维的元素。

意思是(X,DIM)取沿X的维度DIM的平均值。

例如:如果X = [1 2 3; 3 3 6; 4 6 8; 4 7 7];

那么平均值(X,1)是[3.0000 4.5000 6.0000]和

平均值(X,2)是[2.0000 4.0000 6.0000 6.0000]

2 prestd(改名为mapstd) poststd postreg

poststd后处理由PRESTD预处理的数据。

在R2006a NNET 5.0中已经过时。最后用于R2005b NNET 4.0.6。

句法

[p,t] = poststd(pn,meanp,stdp,tn,表示,stdt)

[p] = poststd(pn,meanp,stdp)

描述

poststd后处理网络培训

设置由PRESTD预处理。它转换

数据返回到非标准化单位。

poststd需要这些输入,

归一化输入向量的PN - RxQ矩阵

MEANP - 包含每个P的标准差的Rx1向量

包含每个P的标准偏差的STDP - Rx1载体

TN - 归一化目标矢量的SxQ矩阵

MEANT - 包含每个T的标准差的Sx1向量

STDT - Sx1矢量包含每个T的标准偏差

并返回,

输入(列)向量的P - RxQ矩阵。

目标向量的T - SxQ矩阵。

例子

在这个例子中,我们用一组训练数据进行归一化

PRESTD,使用规范化的创建和训练网络

数据,模拟网络,对输出进行非标准化

网络使用poststd,并执行之间的线性回归

网络输出(非标准化)和检查目标

网络培训的质量。

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,意思是,stdt] = prestd(p,t);

net = newff(minmax(pn),[5 1],{\'tansig\'\'purelin\'},\'trainlm\');

net = train(net,pn,tn);

an = net(pn);

a = poststd(an,mean,stdt);

[m,b,r] = postreg(a,t);

检验神经网络预测和实际值的函数 postreg,

Posttraining Analysis (postreg)

The performance of a trained network can be measured to some extent by the errors on the training, validation, and test sets, but it is often useful to investigate the network response in more detail. One option is to perform a regression analysis between the network response and the corresponding targets. The routine postreg is designed to perform this analysis.

The following commands illustrate how to perform a regression analysis on the network trained in Summary and Discussion of Early Stopping and Regularization.

a = sim(net,p);

[m,b,r] = postreg(a,t)

m =

0.9874 m表示实际值和预测值的拟合系数,越靠近1 表明 二者越接近

b =

-0.0067 b表示实际值和预测值的拟合截距,越靠近0 表明 效果越好

r =

0.9935 r表示实际值和预测值的相关系数.