8000 Rename inplace --> brute_inplace · seckcoder/scikit-learn@4a6e16f · GitHub
[go: up one dir, main page]

Skip to content

Commit 4a6e16f

Browse files
author
Fabian Pedregosa
committed
Rename inplace --> brute_inplace
1 parent f90d456 commit 4a6e16f

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

doc/modules/neighbors.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ in the k nearest neighbors of a point is assigned to this point.
2222

2323
It is possible to use different nearest neighbor search strategies by
2424
using the keyword ``strategy``. Possible values are ``'auto'``,
25-
``'ball_tree'``, ``'brute'`` and ``'inplace'``. ``'ball_tree'`` will
26-
create an instance of :class:`BallTree` to conduct the search, which
27-
is usually very efficient in low-dimensional spaces. In higher
25+
``'ball_tree'``, ``'brute'`` and ``'brute_inplace'``. ``'ball_tree'``
26+
will create an instance of :class:`BallTree` to conduct the search,
27+
which is usually very efficient in low-dimensional spaces. In higher
2828
dimension, a brute-force approach is is prefered thus parameters
29-
``'brute'`` and ``'inplace'`` can be used . Both conduct a brute-force
30-
search, the difference being that ``'inplace'`` does not perform any
31-
precomputations, and thus is better suited for low-memory settings.
32-
Finally, ``'auto'`` is a simple heuristic that will guess the best
33-
approach based on the current dataset.
29+
``'brute'`` and ``'brute_inplace'`` can be used . Both conduct a
30+
brute-force search, the difference being that ``'brute_inplace'`` does
31+
not perform any precomputations, and thus is better suited for
32+
low-memory settings. Finally, ``'auto'`` is a simple heuristic that
33+
will guess the best approach based on the current dataset.
3434

3535

3636
.. figure:: ../auto_examples/images/plot_neighbors.png

scikits/learn/neighbors.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ class NeighborsClassifier(BaseEstimator, ClassifierMixin):
2222
window_size : int, optional
2323
Window size passed to BallTree
2424
25-
strategy : {'auto', 'ball_tree', 'brute', 'inplace'}, optional
25+
strategy : {'auto', 'ball_tree', 'brute', 'brute_inplace'}, optional
2626
Strategy used to compute the nearest neighbors. 'ball_tree'
27-
will construct a BallTree, 'brute' and 'inplace' will perform
28-
brute-force search.'auto' will guess the most appropriate based
29-
on current dataset.
27+
will construct a BallTree, 'brute' and 'brute_inplace' will
28+
perform brute-force search.'auto' will guess the most
29+
appropriate based on current dataset.
3030
3131
Examples
3232
--------
@@ -160,7 +160,7 @@ def predict(self, X, **params):
160160

161161
# .. get neighbors ..
162162
if self.ball_tree is None:
163-
if self.strategy == 'inplace':
163+
if self.strategy == 'brute_inplace':
164164
neigh_ind = knn_brute(self._fit_X, X, self.n_neighbors)
165165
else:
166166
from .metrics import euclidean_distances
@@ -203,11 +203,11 @@ class NeighborsRegressor(NeighborsClassifier, RegressorMixin):
203203
mode : {'mean', 'barycenter'}, optional
204204
Weights to apply to labels.
205205
206-
strategy : {'auto', 'ball_tree', 'brute', 'inplace'}, optional
206+
strategy : {'auto', 'ball_tree', 'brute', 'brute_inplace'}, optional
207207
Strategy used to compute the nearest neighbors. 'ball_tree'
208-
will construct a BallTree, 'brute' and 'inplace' will perform
209-
brute-force search.'auto' will guess the most appropriate based
210-
on current dataset.
208+
will construct a BallTree, 'brute' and 'brute_inplace' will
209+
perform brute-force search.'auto' will guess the most
210+
appropriate based on current dataset.
211211
212212
Examples
213213
--------
@@ -256,7 +256,7 @@ def predict(self, X, **params):
256256

257257
# .. get neighbors ..
258258
if self.ball_tree is None:
259-
if self.strategy == 'inplace':
259+
if self.strategy == 'brute_inplace':
260260
neigh_ind = knn_brute(self._fit_X, X, self.n_neighbors)
261261
else:
262262
from .metrics.pairwise import euclidean_distances

0 commit comments

Comments
 (0)
0