我有以下大小为 300 x 2 的矩阵,其中包含最小-最大标准化数据:
# Pre-Process data
scaled_acc = preprocess(mtx_accuracy);
# PCA on mtx_accuracy
[pcvars pcvecs] = princomp(scaled_acc);
preprocess
是一个缩放函数:
function zScore = preprocess(data)
means = ones(length(data),1);
means = means * mean(data);
stds = ones(length(data),1);
stds = stds * std(data);
zScore = (data - means) ./ stds;
endfunction
如何减少(到 1 维)和投影数据,以便我有一个单列向量?