Skip to content

Commit ba898fb

Browse files
committed
iter
1 parent 80e6826 commit ba898fb

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

doc/whats_new/v0.10.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,20 @@ Deprecation
1919
estimator where `n_jobs` is set.
2020
:pr:`887` by :user:`Guillaume Lemaitre <glemaitre>`.
2121

22+
- The fitted attribute `estimator_` in
23+
:class:`~imblearn.under_sampling.CondensedNearestNeighbour`
24+
has been deprecated and will be removed in 0.12. Instead, use the
25+
`n_neighbors_` fitted attribute.
26+
:pr:`891` by :user:`Guillaume Lemaitre <glemaitre>`.
27+
2228
Enhancements
2329
............
2430

2531
- Add support to accept compatible `NearestNeighbors` objects by only
2632
duck-typing. For instance, it allows to accept cuML instances.
2733
:pr:`858` by :user:`NV-jpt <NV-jpt>` and
2834
:user:`Guillaume Lemaitre <glemaitre>`.
35+
36+
- Add support to accept compatible `KNearestNeighbors` objects that can be
37+
clone and have an attribute `n_neighbors`.
38+
:pr:`891` by :user:`Guillaume Lemaitre <glemaitre>`.

imblearn/under_sampling/_prototype_selection/_condensed_nearest_neighbour.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,9 @@ def _fit_resample(self, X, y):
233233
def _more_tags(self):
234234
return {"sample_indices": True}
235235

236-
@deprecated(
237-
"`estimator_` is deprecated in version 0.10 and will be removed in version "
238-
"0.12. Use `n_neighbors_` instead."
236+
@deprecated( # type: ignore
237+
"`estimator_` is deprecated in version 0.10 and will be "
238+
"removed in version 0.12. Use `n_neighbors_` instead."
239239
)
240240
@property
241241
def estimator_(self):

imblearn/under_sampling/_prototype_selection/tests/test_condensed_nearest_neighbour.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,8 @@ def test_cnn_estimator_deprecation():
113113
msg = "`estimator_` is deprecated in version 0.10"
114114
with pytest.warns(FutureWarning, match=msg):
115115
assert cnn.estimator_ == cnn.n_neighbors_
116+
117+
118+
def test_cnn_custom_knn():
119+
# FIXME: accept any arbitrary KNN classifier
120+
pass

0 commit comments

Comments
 (0)