문제

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 algorithm.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top