Skip to content

REF/TST: glm links - #8569

Merged
josef-pkt merged 4 commits into
statsmodels:mainfrom
josef-pkt:ref_glm_link_check_new
Dec 10, 2022
Merged

josef-pkt merged 4 commits into
statsmodels:mainfrom
josef-pkt:ref_glm_link_check_new

Conversation

@josef-pkt

@josef-pkt josef-pkt commented Dec 8, 2022 •

Copy link
Copy Markdown
Member

first commit here is to silence the unit test warnings.
code and tests are adjusted to avoid deprecated link names
back to 3 warnings when running all genmod unit tests
1 negbin warning still to silence

includes option to turn of link check, closes #1880 (previous PR)

@josef-pkt

Copy link
Copy Markdown
Member Author

discrete tests have 70 warnings, but none are future warnings for links (I expected at least some)
most warnings are L1 fit_regularized, plus several or many convergence warnings.

there should be GLM based tests also in other directories.

@josef-pkt
josef-pkt force-pushed the ref_glm_link_check_new branch from 51991c5 to 37b8acd Compare December 9, 2022 14:41
@josef-pkt josef-pkt mentioned this pull request Dec 9, 2022
16 of 20 tasks
@josef-pkt

Copy link
Copy Markdown
Member Author

I tried to figure out some warnings in discrete unit tests. Too time consuming.
for example
I add catch_warnings in test_truncated_model.py fit_regularized but it does not catch all ConvergenceWarnings. I cannot figure out why not.

merging when green

alpha = np.ones(len(self.res1.params))
res_reg = model.fit_regularized(alpha=alpha*0.01, disp=0)

with warnings.catch_warnings():

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Any reason not to use with pytest.warns(UserWarning) to simplify?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It shouldn't raise a warning. This is just to reduce a bit of test noise.
fit_regularized failures should be investigated and cleared up, but I never took the time for it for the new count models.

@josef-pkt
josef-pkt force-pushed the ref_glm_link_check_new branch from a770d5b to 21c9afc Compare December 9, 2022 17:43
@josef-pkt

Copy link
Copy Markdown
Member Author

imported ConvergenceWarning twice, amended and force pushed

@josef-pkt

josef-pkt commented Dec 10, 2022 •

Copy link
Copy Markdown
Member Author

all green, unrelated failures (the usual)

This only added option to turn off link check, I didn't add an trivariate option to warn instead of raise

@josef-pkt
josef-pkt merged commit ee14184 into statsmodels:main Dec 10, 2022
@josef-pkt
josef-pkt deleted the ref_glm_link_check_new branch December 10, 2022 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants