-
-
Notifications
You must be signed in to change notification settings - Fork 127
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
interpret
support group effects
#721
interpret
support group effects
#721
Conversation
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
Signed-off-by: Nathaniel <[email protected]>
I would like to ask two things:
|
Codecov Report
@@ Coverage Diff @@
## main #721 +/- ##
==========================================
+ Coverage 89.50% 89.56% +0.05%
==========================================
Files 44 44
Lines 3526 3525 -1
==========================================
+ Hits 3156 3157 +1
+ Misses 370 368 -2
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Yes, you are right. I checked out this branch from Nathaniel's branch. I have removed everything from that branch now. As for tests go, I have added a model with common and group effects. I test each plotting function in |
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.
Looks great! You can hit the green button! (squash and merge)
* [715] Adding Mr P docs Signed-off-by: Nathaniel <[email protected]> * [715] updating black formatting and suppressing numpyro messages Signed-off-by: Nathaniel <[email protected]> * [715] adding plot_comparisons checks on basic model Signed-off-by: Nathaniel <[email protected]> * remove Mr.P example and metadata * support group-specific-effects default values and sampling from new groups * use set with in for conditional statement * remove commits related to PR bambinos#715 * add group specific effects for interpret plotting functions --------- Signed-off-by: Nathaniel <[email protected]> Co-authored-by: Nathaniel <[email protected]>
This PR resolves the
KeyError
in PR #716. This error was the result of no default values being computed for model terms specified as group level effects. This is because group level effects do not have a components attribute, and thus never satisfied the logic in theset_default_values()
function of../interpret/utils.py
.Now, to compute default values, all unique common and group specific effects variable names are identified by accessing the
components
andfactor
attributes and are put into a list. From there, the data type is determined by identifying the data types used to fit the model which is then used to determine the function call (mean
ormode
for numeric and categorical dtypes, respectively).Additionally, with group specific effects, when the user (or default values are computed) passes values, it is possible these values are new unseen data. Thus, I leverage PR #693 and add the arg
sample_new_groups
to the functionspredictions
,comparisons
, andslopes
(and the associated plotting functions) to allow plotting of new groups.For a working example, view my last comment in PR #716.
To do: