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

Skip to content

DOC Ensures that radius_neighbors_graph passes numpydoc #22462

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions sklearn/neighbors/_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def radius_neighbors_graph(
include_self=False,
n_jobs=None,
):
"""Computes the (weighted) graph of Neighbors for points in X
"""Compute the (weighted) graph of Neighbors for points in X.

Neighborhoods are restricted the points at a distance lower than
radius.
Expand Down Expand Up @@ -174,7 +174,7 @@ def radius_neighbors_graph(
(l2) for p = 2. For arbitrary p, minkowski_distance (l_p) is used.

metric_params : dict, default=None
additional keyword arguments for the metric function.
Additional keyword arguments for the metric function.

include_self : bool or 'auto', default=False
Whether or not to mark each sample as the first nearest neighbor to
Expand All @@ -193,6 +193,10 @@ def radius_neighbors_graph(
Graph where A[i, j] is assigned the weight of edge that connects
i to j. The matrix is of CSR format.

See Also
--------
kneighbors_graph: Compute the weighted graph of k-neighbors for points in X.

Examples
--------
>>> X = [[0], [3], [1]]
Expand All @@ -203,10 +207,6 @@ def radius_neighbors_graph(
array([[1., 0., 1.],
[0., 1., 0.],
[1., 0., 1.]])

See Also
--------
kneighbors_graph
"""
if not isinstance(X, RadiusNeighborsMixin):
X = NearestNeighbors(
Expand Down
1 change: 0 additions & 1 deletion sklearn/tests/test_docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@
"sklearn.model_selection._validation.learning_curve",
"sklearn.model_selection._validation.permutation_test_score",
"sklearn.model_selection._validation.validation_curve",
"sklearn.neighbors._graph.radius_neighbors_graph",
"sklearn.pipeline.make_union",
"sklearn.preprocessing._data.binarize",
"sklearn.preprocessing._data.maxabs_scale",
Expand Down