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

GBReweights seems to be not working in my case #84

Closed
Soumyatifr opened this issue Nov 30, 2023 · 4 comments
Closed

GBReweights seems to be not working in my case #84

Soumyatifr opened this issue Nov 30, 2023 · 4 comments

Comments

@Soumyatifr
Copy link

Soumyatifr commented Nov 30, 2023

Dear experts,
I am using GBreweighting to reweight control region (original) data to a signal data (target data), roughly the statistics of these two regions are : for control region ~ 1.5M and for signal region 25K, and I am using 5-7 variables for the reweighing, the individual KS score is high for only one variable around 0.15 and for the rest of the varaivles KS score < 0.05.
The model I am using :

reweighter = reweight.GBReweighter(n_estimators=30, learning_rate=0.1, max_depth=3, min_samples_leaf=100,
                                   gb_args={'subsample': 0.4}) 

There is no change of the variables before and after the reweighting, the two set of plots are attached here.
Could you please check where I have made the mistake or where I need mofification to make the GBReweighting method useful.
Thanks in advance,
Soumya
Before reweighting
before_reweighting
After reweighting
after_reweighting

@arogozhnikov
Copy link
Owner

Hi @Soumyatifr , interesting case. Can't guess the reason, but for sanity check - how about leaving only one variable ('HT') in training and see if it gets corrected?

@Soumyatifr
Copy link
Author

Dear Alex @arogozhnikov,
Thanks for your very prompt reply, I have checked with only "HT" variable but still it doesn't want, it would be very hgelpful for me, if you can see the code [1] and the two root files , which I have uploaded to my google drive[2].
[1] https://github.com/Soumyatifr/GBReweighting/blob/main/bdt_reweighet.ipynb
[2] https://drive.google.com/drive/folders/1ZCkF0V58O_fC1gnKqFRL-HYaE97mYwbe?usp=sharing

@arogozhnikov
Copy link
Owner

arogozhnikov commented Dec 5, 2023

@Soumyatifr
just ran your code with single HT variable, and it clearly has strong improvements:

before reweighting

after reweighting

hopefully it looks similar in your env, otherwise there is some problem with package versions.

@arogozhnikov
Copy link
Owner

ok, assume that helped

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

No branches or pull requests

2 participants