-2
你好我用MATLAB做下列代码的PCA(我有13个属性)实际上当我运行程序(RBF网络)时有问题,所以我用PCA调整数据,我可以吗使用这种方法?如果是的话,我应该使用矩阵代替我的真实数据吗?使用PCA算法调整数据
% PCA1: Perform PCA using covariance.
% data - MxN matrix of input data
% (M dimensions, N trials)
% signals - MxN matrix of projected data
% PC - each column is a PC
% V - Mx1 matrix of variances
[M,N] = size(data);
% subtract off the mean for each dimension
mn = mean(data,2);
data = data - repmat(mn,1,N);
% calculate the covariance matrix
covariance = 1/(N-1) * data * data’;
% find the eigenvectors and eigenvalues
[PC, V] = eig(covariance);
% extract diagonal of matrix as vector
V = diag(V);
% sort the variances in decreasing order
[junk, rindices] = sort(-1*V);
V = V(rindices);
PC = PC(:,rindices);
% project the original data set
sign
als = PC’ * data;
由于
考虑适当格式化你的问题的代码,请 – Schorsch
谢谢请帮助我,如果你知道吗? – Amin
我不清楚你的问题是什么。 “信号矩阵”是什么意思? –