diff --git a/src/glum/_glm.py b/src/glum/_glm.py index e7f221de..dde0bfbc 100644 --- a/src/glum/_glm.py +++ b/src/glum/_glm.py @@ -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: