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

[Feature Request] Add kneighbors_graph method to all transformers supporting mode={"connectivity", "distance"} and include_self={True,False} #41

Open
jolespin opened this issue May 20, 2024 · 0 comments

Comments

@jolespin
Copy link

I'm trying to adapt some methods that use kneighbors_graph from scikit-learn but I need access to the mode=connectivity and include_self=True which are not supported in the current fit methods. Here's some more details on the problem: https://stackoverflow.com/questions/78486997/how-to-reproduce-kneighbors-graphinclude-self-true-using-kneighborstransfor . My goal is to speed up some DiffusionMap algorithms that use KNN methods but I need the connectivity and include_self options.

Here's the docs:
https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.kneighbors_graph.html#sklearn.neighbors.kneighbors_graph

mode{‘connectivity’, ‘distance’}, default=’connectivity’
Type of returned matrix: ‘connectivity’ will return the connectivity matrix with ones and zeros, and ‘distance’ will return the distances between neighbors according to the given metric.

include_selfbool or ‘auto’, default=False
Whether or not to mark each sample as the first nearest neighbor to itself. If ‘auto’, then True is used for mode=’connectivity’ and False for mode=’distance’.

@jolespin jolespin changed the title [Feature Request] Add kneighbors_graph method to all transformers supporting mode={"connectivity", "distance"} and include_self=True/False [Feature Request] Add kneighbors_graph method to all transformers supporting mode={"connectivity", "distance"} and include_self={True,False} May 20, 2024
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

No branches or pull requests

1 participant