-
-
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
Plot comparisons notebook for docs #695
Plot comparisons notebook for docs #695
Conversation
deleted docs/notebooks/plot_cap.ipynb#
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Codecov Report
@@ Coverage Diff @@
## main #695 +/- ##
=======================================
Coverage 87.91% 87.91%
=======================================
Files 43 43
Lines 3318 3318
=======================================
Hits 2917 2917
Misses 401 401
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Reads soooo well! Amazing work!!! |
Thank you! I'm excited to get user feedback and tests. |
Just left a very small comment. It looks so good. If you want, feel free to add a note at the end saying this was authored by you as part of your GSoC project. I only have two questions (for now)
edit I think this is ready to be merged |
@@ -0,0 +1,1958 @@ | |||
{ |
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.
Line #6. from bambi.plots import comparisons, plot_comparison
We should be able to import bambi once and then call the plots submodel directly, like
import bambi as bmb
bmb.comparisons or bmb.plot_comparison
Reply via ReviewNB
@@ -0,0 +1,1958 @@ | |||
{ |
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.
It is possible to specify 1 to 2 and 1 to 4 comparisons by writing something like contrast={"persons": [1, (2, 4)]} or with some other syntax?
Reply via ReviewNB
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.
Yes, this can be achieved by passing
contrast={"persons": [1, 2, 4]}
and since we use list(itertools.combinations(contrast.values, 2))
where contrast.values = [1, 2, 4]
, the contrasts end up being a pairwise combination:
(1, 2), (1, 4), (2, 4)
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.
That will generate all combinations, I am asking if it is possible (or even desireable) to write something like this (not necessarily this) contrast={"persons": [1, (2, 4)]}
and get [(1,2), (1,4)]
.
Just left a very small comment. It looks so good. If you want, feel free to add a note at the end saying this was authored by you as part of your GSoC project. I only have two questions (for now)
edit I think this is ready to be merged Thank you! :) Should the results of Currently it does because: (1) if the user wants the estimates, etc. without plotting then this function offers that possibility, and (2) if the user wants to perform their own plotting (for whatever reason) then they have access to the same data we use for plotting. What are your thoughts? In the "Default contrast and conditional values" it says "Bambi computes the mean and then subtracts and adds 2.5 units..." Does it work the same way in marginaleffects? I'm thinking about how well it can work with different scales of data. Very good point. By default, I use a one unit centered difference, i.e., |
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.
LGTM
Thanks for the review! Much appreciated! |
@GStechschulte now we have some conflicts. I can merge once they are fixed :) |
Good to go now :) Thanks! |
This PR adds a demo notebook for the Bambi docs explaining the following:
comparisons
andplot_comparisons
iscomparisons
andplot_comparisons
and the various quantities of interest: unit level, grid, averageUltimately, this docs example builds off of this blog post, but will go into more detail along with more examples.
This is a draft PR and can only be merged once #684 is merged.