Skip to content

Commit

Permalink
Merge pull request #166 from y0z/feature/fix-ci
Browse files Browse the repository at this point in the history
Fix for mypy
  • Loading branch information
toshihikoyanase authored Oct 17, 2024
2 parents 935b449 + 15bdb7a commit 403d8e8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion optuna_integration/sklearn/sklearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,10 @@ def _cross_validate_with_pruning(
if is_classifier(estimator):
partial_fit_params = self.fit_params.copy()
y = self.y.values if isinstance(self.y, pd.Series) else self.y
classes = np.unique(y)
if y is not None:
classes = np.unique(y)
else:
classes = np.array([None])

partial_fit_params.setdefault("classes", classes)

Expand Down

0 comments on commit 403d8e8

Please sign in to comment.