-
Notifications
You must be signed in to change notification settings - Fork 842
Support NaN values in UpliftTree and UpliftRandomForest #860
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
base: master
Are you sure you want to change the base?
Support NaN values in UpliftTree and UpliftRandomForest #860
Conversation
|
The Read the Docs build failure appears to be due to Cython extensions requiring a compiler in the RTD environment. |
jeongyoonlee
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution, @aman-coder03. I left a few comments. Can you address them? Also, please add test code to tests/test_uplift_trees.py accordingly. Thanks!
| is_split_by_gt = False | ||
|
|
||
| for value in lsUnique: | ||
| len_X_l = group_counts_by_divide(columnValues, value, is_split_by_gt, treatment_idx, y, left_count_arr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need this code block. Is there any reason you removed it?
| n_reg | ||
| ) | ||
|
|
||
| early_stopping_flag = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need this code block for early stopping.
causalml/inference/tree/uplift.pyx
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NaN handling is needed here in the percentile calculation.
|
@jeongyoonlee i will look into this! |
e13b20b to
bd23f63
Compare
This PR adds native support for missing values (NaNs) in
UpliftTreeandUpliftRandomForest.Each candidate split evaluates both possible NaN routing directions
(left/right) and learns the optimal routing per node, similar to
scikit-learn’s decision tree behavior.
The learned NaN routing is stored in each tree node and applied
consistently during training, pruning, filling, and prediction.
This resolves #802.