-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
我不清楚你的問題是什麼。 「信號矩陣」是什麼意思? –