Quantco / metalearners

MetaLearners for CATE estimation
https://metalearners.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
34 stars 4 forks source link

Implement adaptive clipping switch #59

Closed FrancescMartiEscofetQC closed 4 months ago

FrancescMartiEscofetQC commented 4 months ago

Solves #52.

Checklist

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

kklein commented 4 months ago

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 commented 4 months ago

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.

kklein commented 4 months ago

FYI @ArseniyZvyagintsevQC @MatthiasLoefflerQC :)