Cap default LGBM num_leaves to fold/arm sample size in cate_scoring - #1038
Open
aman-coder03 wants to merge 1 commit into
Open
Cap default LGBM num_leaves to fold/arm sample size in cate_scoring#1038aman-coder03 wants to merge 1 commit into
num_leaves to fold/arm sample size in cate_scoring#1038aman-coder03 wants to merge 1 commit into
Conversation
Contributor
|
I can see that AI was used to work on this issue. I recommend using AI to plan and reason through the problem first, and then implementing and reviewing the solution carefully. Avoid asking AI to directly solve the whole issue, as this can lead to unnecessary changes and make the PR harder to review. Also, this PR adds quite a lot of code and documentation for a relatively small issue. Please consider simplifying the changes and keeping the PR focused on the num_leaves problem. It would also be good to add a test that directly verifies the expected num_leaves value is used for each fold, rather than only checking that the final scores are finite. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
the default learner in
compute_dr_pseudo_outcomes(),dr_score(), andplug_in_t_score()was a fixedLGBMRegressor(num_leaves=64, ...), but these functions fit per-fold and per-arm (10 fits per call with the defaultn_folds=5), each on a fraction of the data. 64 leaves is often way more than a small slice can support, which just triggers "No further splits with positive gain" warnings instead of helping.swapped the fixed default for a sentinel that builds a learner sized to however many rows each fold/arm actually has, capped at 64 leaves like before. Also added a docstring note pointing people at
pseudo_outcome_colwhen comparing multiple models, since that avoids refitting the nuisance models every timefixes #1037
Types of changes
What types of changes does your code introduce to CausalML?
Put an
xin the boxes that applyChecklist
Put an
xin 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.Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc. This PR template is adopted from appium.