We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0b5cfc5 commit fdb8624Copy full SHA for fdb8624
sklearn/utils/multiclass.py
@@ -414,11 +414,7 @@ def _raise_or_return():
414
if issparse(first_row_or_val):
415
first_row_or_val = first_row_or_val.data
416
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
- ):
+ if y.shape[0] > 20 and y.shape[0] > classes.shape[0] > round(0.5 * y.shape[0]):
422
# Only raise the warning when we have at least 20 samples.
423
warnings.warn(
424
"The number of unique classes is greater than 50% of the number "
0 commit comments