Skip to content
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

KernalPCA: raise Errors and Warnings according to eigenvalue decomposition numerical/conditioning issues #12140

Closed
smarie opened this issue Sep 24, 2018 · 1 comment · Fixed by #12145

Comments

@smarie
Copy link
Contributor

smarie commented Sep 24, 2018

In current KernelPCA _fit_transform implementation, nothing prevents or alerts users that the eigenvalue decomposition presents some numerical or conditioning issue. We could check the following (thanks https://github.com/GabrielRilling for the suggestion!):

  • significant imaginary parts in eigenvalues (raise ValueError)
  • significant negative eigenvalues (throw KernelWarning if there is at least a positive eigenvalue, otherwise raise ValueError)
  • significant conditioning issues (huge ratio > 1e12 between large and small eigenvalues) (throw KernelWarning)

We should also perform some cleaning for non-significant issues (due to numerical approximation) and for the above when no error is raised:

  • remove unsignificant imaginary parts
  • set negative eigenvalues to zero
  • set extremely small eigenvalues (with respect to the largest ones) to zero

This will provide more robust and stable numerical computation across runs/platforms/noise.

@smarie
Copy link
Contributor Author

smarie commented Sep 24, 2018

Note: I initially made a mistake with the issue number in the commit message above but fixed it and force-pushed again so it is not relevant anymore.

I will create a dedicated PR for this issue, that depends on #12143 (because fixing this issue requires that the problem with zero eigenvalues is solved first).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant