You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add option to Isomap for using a precomputed neighborhood graph #2792
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.
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.
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_.
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.
Activity
agramfort commentedon Jan 25, 2014
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.
perimosocordiae commentedon Jan 26, 2014
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_transformfunction. Perhaps the correct angle is to add a subclass ofNearestNeighborswhich simply holds a given neighbor graph, and allow users to use that asIsomap.nbrs_.agramfort commentedon Jan 26, 2014
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.