Skip to content

[BUG] Ensure gamma/poission always get positive y in doctest#660

Merged
fkiraly merged 1 commit into
sktime:mainfrom
Omswastik-11:GAMRegressor-bug-fix
Nov 27, 2025
Merged

[BUG] Ensure gamma/poission always get positive y in doctest#660
fkiraly merged 1 commit into
sktime:mainfrom
Omswastik-11:GAMRegressor-bug-fix

Conversation

@Omswastik-11
Copy link
Copy Markdown
Contributor

Fixes #659

Issue


The issue was in doc_test itwas passing non-positive values to distributions like poisson and binomial

Exception raised:
Traceback (most recent call last):
File "C:\Users\omswa\AppData\Local\Programs\Python\Python312\Lib\doctest.py", line 1368, in __run
exec(compile(example.source, filename, "single",
File "<doctest GAMRegressor[11]>", line 1, in
gam_gamma.fit(X, y)
File "C:\Users\omswa\Desktop\skpro\skpro\regression\base_base.py", line 116, in fit
return self._fit(X_inner, y_inner)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\omswa\Desktop\skpro\skpro\regression\gam_gam.py", line 189, in fit
self.estimator
.fit(X_np, y_np)
File "C:\Users\omswa\Desktop\skpro.venv\Lib\site-packages\pygam\pygam.py", line 886, in fit
y = check_y(y, self.link, self.distribution, verbose=self.verbose)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\omswa\Desktop\skpro.venv\Lib\site-packages\pygam\utils.py", line 238, in check_y
raise ValueError(
ValueError: y data is not in domain of log link function. Expected domain: [np.float64(0.0), np.float64(inf)], but found [-169.89, 312.82]

Approach


Ensured always positive values being passed to poission or gamma .

image

Copy link
Copy Markdown
Collaborator

@fkiraly fkiraly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good catch

@fkiraly fkiraly merged commit 42ce3c7 into sktime:main Nov 27, 2025
52 checks passed
@Omswastik-11 Omswastik-11 deleted the GAMRegressor-bug-fix branch November 27, 2025 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] GAMRegressor failure in docstring examples

2 participants