Skip to content

Add option to Isomap for using a precomputed neighborhood graph #2792

Closed

Description

@perimosocordiae

Theoretically, there's no reason why Isomap can't operate on an abitrary graph, but the existing implementation assumes a k-nearest neighbor graph.

Adding an option for using a precomputed graph would match the API for SpectralEmbedding, which can accept a precomputed affinity matrix in addition to using standard methods for its construction.

Activity

  1. agramfort commented on Jan 25, 2014

    @agramfort
    Member

    on what problems do you expect an improvement? Personally I would solve my
    problem by subclassing. You could open a PR to make this subclassing easier
    though.

  2. perimosocordiae commented on Jan 26, 2014

    @perimosocordiae
    ContributorAuthor

    I'm looking to evaluate several graph construction algorithms, so being able to swap in different graphs to nonlinear dimension reduction algorithms is pretty key. I have other metrics of evaluation, but comparing the resulting embeddings is useful.

    Given the current Isomap implementation, a subclass wouldn't be able to share much code (see the _fit_transform function. Perhaps the correct angle is to add a subclass of NearestNeighbors which simply holds a given neighbor graph, and allow users to use that as Isomap.nbrs_.

  3. agramfort commented on Jan 26, 2014

    @agramfort
    Member

    Given the current Isomap implementation, a subclass wouldn't be able to
    share much code (see the fit_transformhttps://github.com/scikit-learn/scikit-learn/blob/master/sklearn/manifold/isomap.py#L93function. Perhaps the correct angle is to add a subclass of
    NearestNeighbors which simply holds a given neighbor graph, and allow
    users to use that as Isomap.nbrs
    .

    indeed it would be hard to subclass now. Hence my suggestion to refactor to
    make your life easier. It you introduce a private method to return the
    neighbors then it should do the trick.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions