Skip to content

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

Closed

Description

@smarie

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.

Activity

  1. added a commit that references this issue on Sep 24, 2018
    493e7b5
  2. smarie commented on Sep 24, 2018

    @smarie
    ContributorAuthor

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

  3. added a commit that references this issue on Sep 24, 2018
    cb7cd15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions