Skip to content

Commit 82bcda2

Browse files
jaquesgrobleramueller
authored andcommitted
update warning box
1 parent 0985264 commit 82bcda2

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

doc/modules/neighbors.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@ of each option, see `Nearest Neighbor Algorithms`_.
5454
.. warning::
5555

5656
Regarding the Nearest Neighbors algorithms, if it is found that two
57-
neighbors, neighbor `k+1` and `k`, have the same distances, the
58-
results will depend on the data order.
57+
neighbors, neighbor `k+1` and `k`, have identical distances but
58+
but different labels, the results will depend on the odering of the
59+
training data.
5960

6061
.. _classification:
6162

sklearn/neighbors/classification.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,10 @@ class KNeighborsClassifier(NeighborsBase, KNeighborsMixin,
9393
9494
.. warning::
9595
96-
If it is found that two neighbors, neighbor `k+1` and `k`,
97-
have the same distance, the results will depend on the data order.
96+
Regarding the Nearest Neighbors algorithms, if it is found that two
97+
neighbors, neighbor `k+1` and `k`, have identical distances but
98+
but different labels, the results will depend on the odering of the
99+
training data.
98100
99101
http://en.wikipedia.org/wiki/K-nearest_neighbor_algorithm
100102
"""

sklearn/neighbors/regression.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,10 @@ class KNeighborsRegressor(NeighborsBase, KNeighborsMixin,
9393
9494
.. warning::
9595
96-
If it is found that two neighbors, neighbor `k+1` and `k`,
97-
have the same distance, the results will depend on the data order.
96+
Regarding the Nearest Neighbors algorithms, if it is found that two
97+
neighbors, neighbor `k+1` and `k`, have identical distances but
98+
but different labels, the results will depend on the odering of the
99+
training data.
98100
99101
http://en.wikipedia.org/wiki/K-nearest_neighbor_algorithm
100102
"""

0 commit comments

Comments
 (0)