Skip to content

Commit 9e4152a

Browse files
author
Guillaume Lemaitre
committed
Create the warning 2 subclasses
1 parent cc14bea commit 9e4152a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

imblearn/base.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,9 @@ def fit(self, X, y):
260260

261261
super(BaseBinarySampler, self).fit(X, y)
262262

263+
if np.unique(y) == 1:
264+
warnings.warn('Hello')
265+
263266
# Check that the target type is binary
264267
if not type_of_target(y) == 'binary':
265268
warnings.warn('The target type should be binary.')
@@ -295,12 +298,12 @@ def fit(self, X, y):
295298

296299
super(BaseMulticlassSampler, self).fit(X, y)
297300

301+
if np.unique(y) == 1:
302+
warnings.warn('Hello')
303+
298304
# Check that the target type is either binary or multiclass
299305
if not (type_of_target(y) == 'binary' or
300306
type_of_target(y) == 'multiclass'):
301307
warnings.warn('The target type should be binary or multiclass.')
302308

303-
if np.unique(X).size == 1:
304-
warnings.warn('Hello')
305-
306309
return self

0 commit comments

Comments
 (0)