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

Implement adaptive clipping switch #59

Merged
merged 5 commits into from
Jul 11, 2024
Merged

Conversation

FrancescMartiEscofetQC
Copy link
Contributor

@FrancescMartiEscofetQC FrancescMartiEscofetQC commented Jul 10, 2024

Solves #52.

Checklist

  • Added a CHANGELOG.rst entry

@FrancescMartiEscofetQC FrancescMartiEscofetQC linked an issue Jul 10, 2024 that may be closed by this pull request
Copy link

codecov bot commented Jul 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.96%. Comparing base (f7a64e6) to head (a980caf).
Report is 30 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #59      +/-   ##
==========================================
+ Coverage   94.94%   94.96%   +0.02%     
==========================================
  Files          15       15              
  Lines        1485     1491       +6     
==========================================
+ Hits         1410     1416       +6     
  Misses         75       75              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@FrancescMartiEscofetQC FrancescMartiEscofetQC marked this pull request as ready for review July 10, 2024 12:14
@kklein
Copy link
Collaborator

kklein commented Jul 10, 2024

Thanks for looking into this :)
Would you mind sharing your view on the trade-off between making the clipping a part of the initialization compared to making it an optional parameter for fitting?

@FrancescMartiEscofetQC
Copy link
Contributor Author

Would you mind sharing your view on the trade-off between making the clipping a part of the initialization compared to making it an optional parameter for fitting?

Sure, I thought of this for a while and the main reason why I chose it to be optional at initialization instead of at fit is the fact that we call pseudo_outcome also inside evaluate, and if the pseudo outcomes were computed with adaptive clipping at fit time the evaluation should also be done with adaptive clipping. If we added the parameter to fit we would also require to add it at evaluate and it would be responsibility of the user to ensure that it is the same as when calling fit.

Seeing that both options required me to change a signature of a function which breaks the common API (if the user iterates over the metalearners and always passes the adaptive_clipping parameter it will raise an error for the other metalearners) I believe the best option was to just do it at initialization.

Either way I don't have a really strong opinion for either option so I am open to suggestions or other possible solutions.

Copy link
Collaborator

@kklein kklein left a comment

Choose a reason for hiding this comment

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

LGTM! :)

@FrancescMartiEscofetQC FrancescMartiEscofetQC merged commit 3d8f033 into main Jul 11, 2024
16 checks passed
@FrancescMartiEscofetQC FrancescMartiEscofetQC deleted the dr_clipping branch July 11, 2024 11:53
@kklein
Copy link
Collaborator

kklein commented Jul 11, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extension to DR-Learner: propensity clipping
2 participants