Skip to content

Commit 806c6c2

Browse files
author
Guillaume Lemaitre
committed
Change type of warning
1 parent fbe2872 commit 806c6c2

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

imblearn/base.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ def fit(self, X, y):
8686
# raise RuntimeError("Only one class detected, aborting...")
8787
# Raise a warning for the moment to be compatible with BaseEstimator
8888
if np.unique(y).size == 1:
89-
warnings.warn('Only one class detected, something will get wrong',
90-
RuntimeWarning)
89+
warnings.warn('Only one class detected, something will get wrong')
9190

9291
# Store the size of X to check at sampling time if we have the
9392
# same data

imblearn/combine/tests/test_smote_enn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def test_smote_fit_single_class():
7878
# Resample the data
7979
# Create a wrong y
8080
y_single_class = np.zeros((X.shape[0], ))
81-
assert_warns(RuntimeWarning, smote.fit, X, y_single_class)
81+
assert_warns(UserWarning, smote.fit, X, y_single_class)
8282

8383

8484
def test_smote_fit():

0 commit comments

Comments
 (0)