New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kernelPCA centering #337

Closed
rcurtin opened this Issue Dec 29, 2014 · 1 comment

Comments

Projects
None yet
1 participant
@rcurtin
Member

rcurtin commented Dec 29, 2014

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.

@rcurtin rcurtin self-assigned this Dec 29, 2014

@rcurtin rcurtin added this to the mlpack 1.0.9 milestone Dec 29, 2014

@rcurtin rcurtin closed this Dec 29, 2014

@rcurtin

This comment has been minimized.

Show comment
Hide comment
@rcurtin

rcurtin Dec 30, 2014

Member

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.

Thanks!

Ryan

Member

rcurtin commented Dec 30, 2014

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.

Thanks!

Ryan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment