开发者

PCA: What's wrong with this algorithm?

开发者 https://www.devze.com 2023-01-15 07:45 出处:网络
Can someone please either confirm or correct this Wikipedia algorithm for computing the first principal component?I want a simple implementation of PCA in D, which doesn\'t have any existing libraries

Can someone please either confirm or correct this Wikipedia algorithm for computing the first principal component? I want a simple implementation of PCA in D, which doesn't have any existing libraries for PCA AFAIK. I've tried implementing this, and it doesn't seem like my results on simple examples match stuff I get from R or Octave. I'm pretty sure it's not an implementation bug because I've checked over my implementation several times and even rewritten it from scratch, and it's a pretty simple algorit开发者_C百科hm.


Is your data matrix is zero meaned, as required by the pre-conditions?

The code snippet is unclear on this point, but the way that the data matrix is originally described, I think that the column means need to be zero for the power method to work.

0

精彩评论

暂无评论...
验证码 换一张
取 消