Repository navigation
REF: GLM init invalid kwargs use ValueWarning - #7751
Conversation
|
I changed my mind about not adding it to other models. We will likely add new keywords to models in 0.14. candidate for OLS, WLS is |
|
possible new pattern subclasses still need to opt-in and call the check using The type check ensures that the check is only done in the appropriate class, and not in super classes. To be more precise, the name would need to be |
|
latest commit is a trial, it is set to raise instead of warn in discrete and OLS The tests that assert warn will also cause test failures |
|
Looks like only one fail, and that is expected still missing check_kwargs in WLS and GLS (needs type(self) check other models: RLM, BetaModel, OrderedModel, .... as followup: Maintenance when adding new models, refactorings or enhancements: When we add new subclasses or refactor current subclasses (like ZeroInflated), then the current checks might fail. Adding new explicit keywords to existing classes will not affect kwargs (if they are keywords in the class that does the relevant check_kwargs, e.g. offset to BinaryModel and all it's subclasses, but MNLogit will likely not get |
|
when I add check_kwargs without extra kwds, I get a test failure in
test_regularized_predict is just a consistency check between predict and fittedvalues, no verifying numbers update |
4837617 to
92f1ab4
Compare
|
tests have only the one expected failure (warn versus raise) doc build errored I have no idea and I didn't change GEE directly, And it didn't fail in previous runs Time to clean up PR and merge |
|
adding check_kwargs to GEE, I get test failures with incorrect kwargs
a structural problem GEE extends -> raise |
|
fix until we have a better solution: in |
|
This pull request introduces 1 alert and fixes 1 when merging 19cae58 into 4cf63aa - view on LGTM.com new alerts:
fixed alerts:
|
|
last commit GLM raises, new cases found statsmodels/base/tests/test_penalized.py but why are they not excluded by this is getting tricky, the problem is in llnull
and why does it happen only with GAM should have the same problem, but there are no failing unit tests. incomplete unit tests to fix all those cases. Maybe ignore for now and let the check_kwargs warnings go as noise to the user. a bit dirty as solution: actually, I ran into this before
count_model, discrete_model and betareg moduls use base.model._LLRMixin hass we need this also in GLMResults GAM doesn't have it, so there likely are problems in llnull. |
|
adding this to GLMResults.null fixes base/tests/test_penalized AFAICS, GAM does not extend |
|
idea: add global flag to switch between warning and exception |
|
This pull request fixes 1 alert when merging 843d01e into 4cf63aa - view on LGTM.com fixed alerts:
|
|
all green, two test fail because warning instead of ValueError is expected switch back to warn and then merge |
|
This pull request fixes 1 alert when merging 16f99fc into 4cf63aa - view on LGTM.com fixed alerts:
|
replaces UserWarning by ValueWarning in GLM kwarg check
followup to #7741
this uses now base Model helper function check_kwargs
this adds check_args to
GLM, GEE
discrete CountModel, BinaryModel
RLM
regression: OLS, WLS, GLS, QuantReg
also includes bug fix for #7755 GLS.fit_regularized