Repository navigation
DOC: Follow up #10780 on the DistributedModel signature check, with tests - #10789
Merged
bashtage merged 2 commits intoNov 18, 2026
Merged
Conversation
The directive was the last block of the Raises section, which numpydoc reads as a second exception named ".. versionchanged:: 0.15.1". Move it below the summary line, above Parameters. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…edModel No test failed when the VAR_KEYWORD branch of the fit_regularized signature check, the branch for a model without fit_regularized, or the use of the groups of init_kwds for the placeholder model was removed. Test the check for OLS, a subclass with fit_regularized(**kwargs), a subclass without alpha, GEE and RLM, fit the **kwargs subclass against OLS, and test the groups of the placeholder. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
|
||
| class _OLSNoAlpha(OLS): | ||
| # neither an alpha parameter nor **kwargs | ||
| def fit_regularized(self, method="elastic_net"): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow up to #10780 (
DistributedModelwithGEE, merged at 18:15 UTC on 18 November). The review of its last head left the points below: one docstring directive and tests for the branches of the new check that no test failed without. No change of the behavior ofDistributedModel.NumPy's guide.
Changes
DOC:the.. versionchanged:: 0.15.1ofDistributedModel.fitwas the last block of theRaisessection, so numpydoc read it as a second exception named.. versionchanged:: 0.15.1(numpydoc.docscrape.FunctionDoc: Raises = [NotImplementedError, '.. versionchanged:: 0.15.1']) and Sphinx would show it as one. It is now below the summary line, aboveParameters: Raises = [NotImplementedError], and the directive is in the extended summary.TST:test_check_estimation_method_signatureruns_check_estimation_methodforOLS, a subclass withfit_regularized(self, **kwargs), a subclass with neitheralphanor**kwargs,GEEandRLM(which has nofit_regularized);test_fit_regularized_with_keywords_onlyfits the**kwargssubclass againstOLS(equal to 1e-12, and to the reference values oftest_fit_sequential);test_dummy_model_groupschecks that the placeholder model of aGEEhas thegroupsofinit_kwdsif there are any and one group otherwise.Checks
distributed_estimation.py, each applied alone. With the tests of main only (2) and (5) fail a test (test_gee_debiased_raises_before_fittingandtest_gee_unregularized_naive) and (1), (3) and (4) survive; with this PR all five fail: (1) theVAR_KEYWORDbranch removed:test_check_estimation_method_signature[_OLSKeywordFit-False]andtest_fit_regularized_with_keywords_onlyfail; (2) the check never raises: theRLM,GEEand_OLSNoAlphacases andtest_gee_debiased_raises_before_fittingfail; (3) a model withoutfit_regularizedis accepted: theRLMcase fails; (4) thegroupsofinit_kwdsare overwritten:test_dummy_model_groupswithgroups=[3]fails; (5) no default groups:test_dummy_model_groupswith no groups andtest_gee_unregularized_naivefail.test_distributed_estimation.py: 27 passed (Python 3.13, pandas 3.1.0). On the minimum versions (Python 3.10, NumPy 1.23.5, SciPy 1.8.1, pandas 1.5.3; the tree under test was the one imported) 26 passed andtest_fit_joblibfails: its joblib worker processes import the environment's own editable copy of statsmodels, whose rebuild fails there; the same test fails the same way on unmodified main in that environment.ruff check .andgit diff --checkpass. Sphinx was not run.Not changed (from the review of #10780)
GEEwith a staticconstraintininit_kwdsstill fails at the end offit(the one-column placeholder cannot satisfy a constraint with k columns), andMixedLM,OrdinalGEE,NominalGEEandQIFcannot build the placeholder; the release note and the docstring say only thatGEEworks with the unregularized method, which is what BUG: Support GEE in DistributedModel #10780 claims.RegularizedResultshas onlyparamsandpredict.AI Disclosure
Contributions must comply with the statsmodels AI Policy.
Tick exactly one of the following. If AI tools were used, replace the
<...>placeholders in the second option with the tool name(s) and how the tool's output was
used.
Tool(s): Claude Code (Claude Sonnet 5.5).
Used for: reviewing BUG: Support GEE in DistributedModel #10780, and writing and checking the follow-up changes.
I have personally read, understood, and can explain every line of this diff, and
have verified the statistical/numerical correctness of the change.
🤖 Generated with Claude Code