Repository navigation
BUG: Raise for ignored flags in out-of-sample panel predictions - #849
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #849 +/- ##
=======================================
Coverage 99.68% 99.68%
=======================================
Files 199 199
Lines 37851 37870 +19
Branches 2433 2436 +3
=======================================
+ Hits 37730 37751 +21
+ Misses 53 51 -2
Partials 68 68
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Author
|
Gentle ping on this one — CI is green (15/15) and it is a small, self-contained bug fix. Would appreciate a review when you get a chance. Thanks! |
Owner
|
Thanks. LGTM. |
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.
Fixes #768.
PanelResults.predictsilently ignoredfitted,effectsandidiosyncraticwheneverexogordatawas passed, returning a singlepredictionscolumn regardless of the flags:This contradicts the documented contract: effects and idiosyncratic errors are not available for out-of-sample predictions, and at least one output must be selected.
Changes
ValueErrorwheneffectsoridiosyncraticis requested together withexog/data.ValueError("At least one output must be selected")whenfitted=Falseand no other output is selected, matching the existing in-sample behaviour.Raisessection of the docstring.test_predict_out_of_sample_flagscovering the three previously ignored flags.Verification
linearmodels/tests/panel/: 7061 passed, 73 skipped, 47 xfailed.ruff check,ruff format --checkandnumpydoc lintpass on the changed files.Happy to add a changelog entry or adjust the error type/message if you prefer a different convention.