Skip to content

Commit

Permalink
Updated type check logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Pringled committed Feb 16, 2025
1 parent f9037d9 commit 2dc5b17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion model2vec/train/classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def _initialize(self, y: LabelType) -> None:
"""
if isinstance(y[0], (str, int)):
# Check if all labels are strings or integers.
if not all(isinstance(label, (str | int)) for label in y):
if not all(isinstance(label, (str, int)) for label in y):
raise ValueError("Inconsistent label types in y. All labels must be strings or integers.")

Check warning on line 236 in model2vec/train/classifier.py

View check run for this annotation

Codecov / codecov/patch

model2vec/train/classifier.py#L236

Added line #L236 was not covered by tests
self.multilabel = False
classes = sorted(set(y))
Expand Down

0 comments on commit 2dc5b17

Please sign in to comment.