Skip to content

Commit

Permalink
DOC Ensures that radius_neighbors_graph passes numpydoc (scikit-learn…
Browse files Browse the repository at this point in the history
  • Loading branch information
QuadV authored Feb 12, 2022
1 parent 27e7d3d commit f9d0467
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
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

0 comments on commit f9d0467

Please sign in to comment.