Skip to content

Commit

Permalink
DOC improve docstring example of NearestNeighbors (scikit-learn#26728)
Browse files Browse the repository at this point in the history
  • Loading branch information
glemaitre committed Jun 30, 2023
1 parent a2f1779 commit e602552
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions sklearn/neighbors/_unsupervised.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,11 @@ class NearestNeighbors(KNeighborsMixin, RadiusNeighborsMixin, NeighborsBase):
>>> import numpy as np
>>> from sklearn.neighbors import NearestNeighbors
>>> samples = [[0, 0, 2], [1, 0, 0], [0, 0, 1]]
>>> neigh = NearestNeighbors(n_neighbors=2, radius=0.4)
>>> neigh.fit(samples)
NearestNeighbors(...)
>>> neigh.kneighbors([[0, 0, 1.3]], 2, return_distance=False)
array([[2, 0]]...)
>>> nbrs = neigh.radius_neighbors(
... [[0, 0, 1.3]], 0.4, return_distance=False
... )
Expand Down

0 comments on commit e602552

Please sign in to comment.