Skip to content

Commit

Permalink
Fix logic in binary indicator matrices check
Browse files Browse the repository at this point in the history
  • Loading branch information
gitgithan committed Nov 12, 2018
1 parent c7abc6f commit 02d7650
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/data/multilabel.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def multilabel_sample(y, size=1000, min_count=5, seed=None):
each label.
"""
try:
if (np.unique(y).astype(int) != np.array([0, 1])).all():
if (np.unique(y).astype(int) != np.array([0, 1])).any():
raise ValueError()
except (TypeError, ValueError):
raise ValueError('multilabel_sample only works with binary indicator matrices')
Expand Down

0 comments on commit 02d7650

Please sign in to comment.