Skip to content

Commit fdb8624

Browse files
saskrajeremiedbb
andauthored
Update sklearn/utils/multiclass.py
Co-authored-by: Jérémie du Boisberranger <jeremie@probabl.ai>
1 parent 0b5cfc5 commit fdb8624

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

sklearn/utils/multiclass.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -414,11 +414,7 @@ def _raise_or_return():
414414
if issparse(first_row_or_val):
415415
first_row_or_val = first_row_or_val.data
416416
classes = cached_unique(y)
417-
if (
418-
not suppress_warning
419-
and y.shape[0] > 20
420-
and classes.shape[0] > round(0.5 * y.shape[0])
421-
):
417+
if y.shape[0] > 20 and y.shape[0] > classes.shape[0] > round(0.5 * y.shape[0]):
422418
# Only raise the warning when we have at least 20 samples.
423419
warnings.warn(
424420
"The number of unique classes is greater than 50% of the number "

0 commit comments

Comments
 (0)