Skip to content

Commit e0cddbe

Browse files
author
Guillaume Lemaitre
committed
Add some debugging
1 parent 484af27 commit e0cddbe

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

imblearn/base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from six import string_types
2121

2222

23-
warnings.simplefilter('always', category=UserWarning)
23+
warnings.simplefilter('always', UserWarning)
2424

2525

2626
class SamplerMixin(six.with_metaclass(ABCMeta, BaseEstimator)):
@@ -88,6 +88,9 @@ def fit(self, X, y):
8888
# if uniques.size == 1:
8989
# raise RuntimeError("Only one class detected, aborting...")
9090
# Raise a warning for the moment to be compatible with BaseEstimator
91+
self.logger.debug('The number of classes is %s', np.unique(y).size)
92+
self.logger.debug('Shall we raise a warning: %s',
93+
np.unique(y).size == 1)
9194
if np.unique(y).size == 1:
9295
warnings.warn('Only one class detected, something will get wrong')
9396

0 commit comments

Comments
 (0)