Skip to content
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

fix plot_std_diffs, add bal_tol, condense to one plot #723

Merged
merged 1 commit into from
Dec 8, 2023

Conversation

ras44
Copy link
Collaborator

@ras44 ras44 commented Dec 5, 2023

Proposed changes

This PR fixes a variety of issues in visualize.py related to the functions plot_ps_diagnostics and _plot_std_diffs. Previously, when plotting, no range values/ticks were displayed on the x-axis and the displayed point locations of the IPW standardized diffs in the seaborn plots did not reflect the correct values. This PR also adds a bal_tol argument to adjust the tolerance for what is considered balanced. Finally, the two pre/post plots have been condensed into one plot with hue identifying the pre/post locations of the std diffs:

image

Types of changes

What types of changes does your code introduce to CausalML?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

@ras44
Copy link
Collaborator Author

ras44 commented Dec 8, 2023

FYI, this type of plot is commonly known as a love plot, so an alternative to modifying plot_ps_diagnostics may be to add a new function called love_plot to visualize.py which produces the above image. Nevertheless, currently it appears that the dual-plot image produced by plot_ps_diagnostics does not display results correctly.

Copy link
Collaborator

@jeongyoonlee jeongyoonlee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@jeongyoonlee jeongyoonlee merged commit f200829 into uber:master Dec 8, 2023
3 of 9 checks passed
@jeongyoonlee jeongyoonlee added the bug Something isn't working label Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants