Skip to content

Commit

Permalink
Make error message meet scikit-learn expectations when y is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
stanmart committed Sep 9, 2024
1 parent c59db80 commit 80b3a2d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/glum/_glm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2466,7 +2466,10 @@ def _set_up_and_check_fit_args(
)

if y is None:
raise ValueError("y cannot be None when not using a two-sided formula.")
raise ValueError(
f"Unless using a two-sided formula, {self.__class__.__name__} "
"requires y to be passed, but the target y is None."
)

if not _is_contiguous(X):
if self.copy_X is not None and not self.copy_X:
Expand Down

0 comments on commit 80b3a2d

Please sign in to comment.