Skip to content

Update uplift and Qini curve plots with a fixed random line#799

Merged
jeongyoonlee merged 4 commits into
masterfrom
jeong/fix_random_in_plots
Oct 16, 2024
Merged

Update uplift and Qini curve plots with a fixed random line#799
jeongyoonlee merged 4 commits into
masterfrom
jeong/fix_random_in_plots

Conversation

@jeongyoonlee
Copy link
Copy Markdown
Collaborator

@jeongyoonlee jeongyoonlee commented Oct 13, 2024

Proposed changes

This PR updates the uplift and Qini curve plots with a fixed random line. Currently, we use the average of the ten sets of random estimations. Although it is close to the theoretical straight line, it is not completely the same, and it has caused some confusion (ref: #798, #706). The fixed random should help clarify some of these.

It also simplifies the plot*() functions by removing duplicates between plot_tmlegain() and plot_tmleqini().

Note that get_cumlift(), get_cumgain(), and get_qini() no longer output a column called Random for the random estimate.

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

Further comments

N/A

Copy link
Copy Markdown
Collaborator

@ras44 ras44 left a comment

Choose a reason for hiding this comment

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

LGTM

)
return (qini.sum(axis=0) - qini[RANDOM_COL].sum()) / qini.shape[0]

random_area = np.linspace(qini.iloc[0, 0], qini.iloc[-1, 0], qini.shape[0]).sum()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM vs the RANDOM_COL method- just an exact diagonal line👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants