-
Notifications
You must be signed in to change notification settings - Fork 575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ENH] Support missing regressors in FirstlevelGLM for t contrasts #4076
base: main
Are you sure you want to change the base?
Conversation
👋 @Remi-Gau Thanks for creating a PR! Until this PR is ready for review, you can include the [WIP] tag in its title, or leave it as a github draft. Please make sure it is compliant with our contributing guidelines. In particular, be sure it checks the boxes listed below.
For new features:
For bug fixes:
We will review it as quick as possible, feel free to ping us with questions if needed. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4076 +/- ##
==========================================
- Coverage 91.60% 91.51% -0.09%
==========================================
Files 143 143
Lines 16086 16094 +8
Branches 3340 3343 +3
==========================================
- Hits 14736 14729 -7
- Misses 804 820 +16
+ Partials 546 545 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
50bf9b4
to
30225bc
Compare
the whole implementation relies on catching an error thrown by pandas when evaluating the expression. Does this seem ok to you? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm worried we may arrive to weird situations where the user expects a contrast to have been computed and won't find it. To me contrasts and fixed effects should be defined consistently in all runs of a given fit.
Can you explain a bit more? If by consistently you mean that "all runs should have all conditions" then in that case shouldn't we just close #2401. |
Yes, that's the idea. |
that may add quite a bit of friction for users who have designs that are "response" driven (trials where subject has given a certain response): not sure how frequent those are though. In any case the error that is thrown at the moment is not helping user know what is wrong (it just says something is wrong with the expression), so I can at least recycle this PR to improve this. |
We probably need to document current behavior better. |
Changes proposed in this pull request:
_compute_fixed_effect_contrast
tocompute_fixed_effect_contrast
as it used outside of the module where it is defined"c0 - c1"
)and a
UndefinedVariableError
pandas error is thrown, thenexpression_to_contrast_vector
returnsNone
and the contrast for this run is skipped with a warning.TODO