Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Bug fixes

- Fixed a bug in :class:`under_sampling.NearMiss` which was not picking the right samples during under sampling for the method 3. By `Guillaume Lemaitre`_.
- Fixed a bug in :class:`ensemble.EasyEnsemble`, correction of the `random_state` generation. By `Guillaume Lemaitre`_ and `Christos Aridas`_.
- Fixed a bug in :class:`ensemble.BalanceCascade`, solve the issue to obtain a single array if desired. By `Guillaume Lemaitre`_.

New features
~~~~~~~~~~~~
Expand Down
6 changes: 6 additions & 0 deletions imblearn/ensemble/balance_cascade.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ def _sample(self, X, y):

# Loop to create the different subsets
while b_subset_search:
self.logger.debug('Search boolean: %s', b_subset_search)
# Generate an appropriate number of index to extract
# from the majority class depending of the false classification
# rate of the previous iteration
Expand Down Expand Up @@ -272,6 +273,7 @@ def _sample(self, X, y):

# Check if we have to make an early stopping
if self.n_max_subset is not None:
self.logger.debug('Current number of subset %s', n_subsets)
if n_subsets == (self.n_max_subset - 1):
b_subset_search = False
# Select the remaining data
Expand Down Expand Up @@ -299,6 +301,10 @@ def _sample(self, X, y):

self.logger.debug('The number of subset reached is'
' maximum.')
break
# Specific case with n_max_subset = 1
elif n_subsets > (self.n_max_subset - 1):
break

# Also check that we will have enough sample to extract at the
# next round
Expand Down