Reported by Niteloser on 18 Dec 44486392 02:19 UTC
I have had a look at the kernelPCA source code. When you centre a kernel matrix, should
arma::sum(kernelMatrix, 1) / kernelMatrix.n_cols;
not be computed before you subtract the means from the rows in the previous line?
I seem to be getting inconsistent results when using it, with the first PC disagreeing
with alternative implementations, but then agreeing from the second PC onwards. This seems like a tell-tale sign of centring going wrong.
Commented by rcurtin on 15 Nov 44487334 06:03 UTC
Nice catch, thank you! I've committed a fix in r16722. Can you test the current svn trunk with alternative implementations again, and if they still disagree, can you reopen this ticket? You can get the svn trunk from the subversion repository at http://svn.cc.gatech.edu/fastlab/mlpack/trunk/. Then, if there is still a problem, we can look into it further.