Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@lmcinnes
Copy link
Contributor

@lmcinnes lmcinnes commented Mar 7, 2017

Fix #8416

Isomap does, in fact support sparse input. Code was changed to match the documentation, and a test was added to verify that it doesn't error.

LLE does not support sparse input -- the barycenter_kneighbors_graph function makes use of fancy indexing which is not supported by sparse matrices. Further the claim of support for KDTree, BallTree and NearestNeighbor objects turned out to be false as well. Docs were updated to reflect this.

@lesteve
Copy link
Member

lesteve commented Mar 8, 2017

Your history looks a bit weird, e.g. you have some commits from your work on t-SNE perplexity. Can you fix that?

@lesteve
Copy link
Member

lesteve commented Mar 8, 2017

Please use "Fix #issueNumber" this way the associated issue gets closed automatically when the PR is merged. For more details, look at this.

Note this pattern is not flexible so using "Fix issue #issueNumber" or "Fix for #issueNumber" is not going to work. I have edited your description.

@lmcinnes
Copy link
Contributor Author

lmcinnes commented Mar 8, 2017

Sorry about that -- apparently I got my branching mixed up and had a separate patch carried into this. Should be good now.

Parameters
----------
X : {array-like, sparse matrix, BallTree, KDTree, NearestNeighbors}
X : array-like
Copy link
Member

@lesteve lesteve Mar 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know this code well at all but I found at least one instance where a NearestNeighbors object can be passed as the first argument here. What made you reach the conclusion it was not supported?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried passing in ball trees and kd trees directly to the function and failed on the call to

 data = barycenter_weights(X, X[ind], reg=reg)

due to the indexing. If NearestNeighbors et al. all actually work I can certainly restore that.

@lmcinnes
Copy link
Contributor Author

Is this outdated now by other changes? If so please feel free to close it. If not I would appreciate a review if and when time is available. Thanks.

@lesteve
Copy link
Member

lesteve commented Jun 27, 2018

Thanks for the friendly ping, LGTM. If someone that is more familiar with the manifold code than me can have a look, in particular double-check #8554 (comment),
it would be great!

Parameters
----------
X : {array-like, sparse matrix, BallTree, KDTree, NearestNeighbors}
X : {array-like, BallTree, KDTree, NearestNeighbors}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm this is not working for me with a *Tree, but is working with a NearestNeighbors. Surely we should have a test to that effect?

@lesteve
Copy link
Member

lesteve commented Jun 29, 2018

I can confirm this is not working for me with a *Tree, but is working with a NearestNeighbors. Surely we should have a test to that effect?

I updated the docstrings to a version that seems to be the consensus, i.e. array-like or NearestNeighbors.

I quickly run the tests with a print statement and we do have tests for locally_linear_embedding that takes X as a NearestNeighbors object.

I have no idea about the CircleCI failure but I would just ignore this one.

@jnothman should we had a whats_new entry that says that Isomap can now fit a sparse matrix?

@jnothman
Copy link
Member

jnothman commented Jun 29, 2018 via email

@lesteve lesteve force-pushed the sparse-LLE-Isomap branch from ccbdf58 to c70ab9e Compare June 29, 2018 06:57
@lesteve lesteve force-pushed the sparse-LLE-Isomap branch from c70ab9e to 3ed93ec Compare June 29, 2018 07:06
`Tom Dupre la Tour`_.

- Support sparse input in :meth:`manifold.Isomap.fit`. :issue:`8554` by
:user:`lmcinnes`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should say name here

@lesteve
Copy link
Member

lesteve commented Jul 2, 2018

Good catch @jnothman, I just fixed it. Merging, thanks a lot @lmcinnes!

@lesteve lesteve merged commit e27242a into scikit-learn:master Jul 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants