You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/modules/neighbors.rst
+9-7
Original file line number
Diff line number
Diff line change
@@ -419,12 +419,14 @@ depends on a number of factors:
419
419
a significant fraction of the total cost. If very few query points
420
420
will be required, brute force is better than a tree-based method.
421
421
422
-
Currently, ``algorithm = 'auto'`` selects ``'kd_tree'`` if :math:`k < N/2`
423
-
and the ``'effective_metric_'`` is in the ``'VALID_METRICS'`` list of
424
-
``'kd_tree'``. It selects ``'ball_tree'`` if :math:`k < N/2` and the
425
-
``'effective_metric_'`` is not in the ``'VALID_METRICS'`` list of
426
-
``'kd_tree'``. It selects ``'brute'`` if :math:`k >= N/2`. This choice is based on the assumption that the number of query points is at least the
427
-
same order as the number of training points, and that ``leaf_size`` is
422
+
Currently, ``algorithm = 'auto'`` selects ``'kd_tree'`` if :math:`k < N/2`
423
+
and the ``'effective_metric_'`` is in the ``'VALID_METRICS'`` list of
424
+
``'kd_tree'``. It selects ``'ball_tree'`` if :math:`k < N/2` and the
425
+
``'effective_metric_'`` is in the ``'VALID_METRICS'`` list of
426
+
``'ball_tree'``. It selects ``'brute'`` if :math:`k < N/2` and the
427
+
``'effective_metric_'`` is not in the ``'VALID_METRICS'`` list of
428
+
``'kd_tree'`` or ``'ball_tree'``. It selects ``'brute'`` if :math:`k >= N/2`. This choice is based on the assumption that the number of query points is at least the
429
+
same order as the number of training points, and that ``leaf_size`` is
428
430
close to its default value of ``30``.
429
431
430
432
Effect of ``leaf_size``
@@ -666,7 +668,7 @@ the :math:`m` nearest neighbors of a point :math:`q`. First, a top-down
666
668
traversal is performed using a binary search to identify the leaf having the
667
669
longest prefix match (maximum depth) with :math:`q`'s label after subjecting
668
670
:math:`q` to the same hash functions. :math:`M >> m` points (total candidates)
669
-
are extracted from the forest, moving up from the previously found maximum
671
+
are extracted from the forest, moving up from the previously found maximum
670
672
depth towards the root synchronously across all trees in the bottom-up
671
673
traversal. `M` is set to :math:`cl` where :math:`c`, the number of candidates
672
674
extracted from each tree, is a constant. Finally, the similarity of each of
0 commit comments