main Content

ProcessPCA

带有主成分分析的矩阵的过程列

句法

[Y,PS] = ProcessPCA(X,MaxFrac)
[Y,PS] = ProcessPCA(X,FP)
y = processPCA('apply',x,ps)
x = processpca('反向',y,ps)
名称= processPCA('name')
fp = processPCA('pdefaults')
名称= ProcessPCA('PDESC')
ProcessPCA('pCheck',fp);

描述

ProcessPCA使用主成分分析过程矩阵sis so that each row is uncorrelated, the rows are in the order of the amount they contribute to total variation, and rows whose contribution to total variation are less thanMAXFRAC被删除。

[Y,PS] = ProcessPCA(X,MaxFrac)Xand an optional parameter,

X

n-经过-矩阵

MAXFRAC

删除行的最大差异分数(默认为0)

并返回

y

m-经过-矩阵与n-m删除行

PS

流程设置可以允许价值的一致处理

[Y,PS] = ProcessPCA(X,FP)带parameters as a struct:fp.maxfrac

y = processPCA('apply',x,ps)返回y,给予X和设置PS

x = processpca('反向',y,ps)返回X,给予y和设置PS

名称= processPCA('name')返回此过程方法的名称。

fp = processPCA('pdefaults')返回default process parameter structure.

名称= ProcessPCA('PDESC')返回过程参数描述。

ProcessPCA('pCheck',fp);如果任何参数是非法的,则会引发错误。

例子

Here is how to format a matrix with an independent row, a correlated row, and a completely redundant row so that its rows are uncorrelated and the redundant row is dropped.

x1_independent = rand(1,5)x1_correalated = rand(1,5) + x1_indepentent;x1_redeartion = x1_independent + x1_correcated x1 = [x1_independent;x1_corlyated;x1_redeend] [y1,ps] = ProcessPCA(x1)

接下来,将相同的处理设置应用于新值。

x2_indepentent = rand(1,5)x2_correalated = rand(1,5) + x1_indepentent;x2_redeartion = x1_independent + x1_correcated x2 = [x2_independent;x2_corlyated;x2_redlext];Y2 = ProcessPCA('Apply',X2,PS)

Reverse the processing ofY1要得到x1again.

X1_AGAIN = ProcessPCA('reververs',Y1,PS)

更多关于

全部收缩

使用使用的输入维度ProcessPCA

在某些情况下,输入向量的尺寸很大,但是向量的组件高度相关(冗余)。在这种情况下,它很有用输入向量。执行此操作的有效程序是principal component analysis. This technique has three effects: it orthogonalizes the components of the input vectors (so that they are uncorrelated with each other), it orders the resulting orthogonal components (principal components) so that those with the largest variation come first, and it eliminates those components that contribute the least to the variation in the data set. The following code illustrates the use ofProcessPCA,使用处理设置执行主组件分析MAXFRACof 0.02

[pn,ps1] = mapstd(p); [ptrans,ps2] = processpca(pn,0.02);

首先使用输入向量进行标准化MAPSTD,使它们的平均值和统一差异为零。使用主组件时,这是一个标准过程。在此示例中,第二个参数传递给ProcessPCAis 0.02. This means thatProcessPCAeliminates those principal components that contribute less than 2% to the total variation in the data set. The matrixptrans包含转换后的输入向量。设置结构PS2包含主组件转换矩阵。培训网络后,应使用这些设置来转换应用于网络的任何未来输入。就像网络的权重和偏见一样,它实际上成为网络的一部分。如果乘以归一化的输入向量pn转换矩阵transMat, you obtain the transformed input vectorsptrans

如果ProcessPCA用于预处理训练集数据,然后每当训练有素的网络与新输入一起使用时,您应该使用用于训练集的转换矩阵进行预处理,并使用PS2。The following code applies a new set of inputs to a network already trained.

pnewn = mapstd('apply',pnew,ps1);pnewtrans = ProcessPCA('apply',pnewn,ps2);a = sim(net,pnewtrans);

Principal component analysis is not reliably reversible. Therefore it is only recommended for input processing. Outputs require reversible processing functions.

主组件分析不是默认处理的一部分feedforwardnet。您可以使用以下命令添加此命令:

net.inputs {1} .processfcns {end+1} ='ProcessPCA';

算法

元素不全部相同值的行中的值设置为

y = 2*(x-minx)/(maxx-minx)-1;

所有相同值的行中的值设置为0。

版本历史记录

在R2006a中引入

也可以看看

||