From 2742dfa5f443c36e59ed7f9de101200726329bb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Magimel?= Date: Fri, 28 Oct 2016 23:33:41 +0200 Subject: [PATCH 1/2] Remove useless code in SMOTE_ENN The `size_ngh` deprecation warning is already declared in the `SamplerMixin` class. Ref #173 --- imblearn/combine/smote_enn.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/imblearn/combine/smote_enn.py b/imblearn/combine/smote_enn.py index 022d11d3b..47b603913 100644 --- a/imblearn/combine/smote_enn.py +++ b/imblearn/combine/smote_enn.py @@ -156,12 +156,6 @@ def fit(self, X, y): super(SMOTEENN, self).fit(X, y) - # Annonce deprecation if necessary - if self.size_ngh is not None: - warnings.warn('`size_ngh` will be replaced in version 0.4. Use' - ' `n_neighbors` instead.', DeprecationWarning) - self.n_neighbors = self.size_ngh - # Fit using SMOTE self.sm.fit(X, y) From c66c35b74152cc04a1a5c3fe1e0bb40fd94af68e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Magimel?= Date: Fri, 28 Oct 2016 23:34:54 +0200 Subject: [PATCH 2/2] Replace a `size_ngh` deprecated variable --- imblearn/under_sampling/edited_nearest_neighbours.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imblearn/under_sampling/edited_nearest_neighbours.py b/imblearn/under_sampling/edited_nearest_neighbours.py index 9409ef81d..3391ace88 100644 --- a/imblearn/under_sampling/edited_nearest_neighbours.py +++ b/imblearn/under_sampling/edited_nearest_neighbours.py @@ -601,7 +601,7 @@ def _sample(self, X, y): for curr_size_ngh in range(1, self.n_neighbors + 1): self.logger.debug('Apply ENN size_ngh #%s', curr_size_ngh) # updating ENN size_ngh - self.enn_.size_ngh = curr_size_ngh + self.enn_.n_neighbors = curr_size_ngh if self.return_indices: X_enn, y_enn, idx_enn = self.enn_.fit_sample(X_, y_)