Skip to content

Commit 9c71994

Browse files
committed
DOC deprecation of **kwargs in neighbors per 0.18
1 parent daf591d commit 9c71994

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

doc/whats_new.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,17 @@ Bug fixes
4848
- The ``transform`` of :class:`lda.LDA` now projects the input on the most
4949
discriminant directions. By Martin Billinger.
5050

51+
- Nearest neighbors estimators now reliably work inside ``GridSearchCV``,
52+
thanks to Nikolay Mayorov.
53+
54+
55+
API changes summary
56+
-------------------
57+
58+
- Nearest neighbors estimators used to take arbitrary keyword arguments
59+
and pass these to their distance metric. This will no longer be supported
60+
in scikit-learn 0.18; use the ``metric_params`` argument instead.
61+
5162

5263
.. _changes_0_15:
5364

sklearn/neighbors/base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,9 @@ def _init_params(self, n_neighbors=None, radius=None,
101101
p=2, metric_params=None, **kwargs):
102102
if kwargs:
103103
warnings.warn("Passing additional arguments to the metric "
104-
"function as **kwargs is deprecated. "
105-
"Use metric_params dict instead.",
104+
"function as **kwargs is deprecated "
105+
"and will no longer be supported in 0.18. "
106+
"Use metric_params instead.",
106107
DeprecationWarning, stacklevel=3)
107108
if metric_params is None:
108109
metric_params = {}

0 commit comments

Comments
 (0)