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

[R-package] Callback for change weights after iteration #6580

Open
jaguerrerod opened this issue Jul 30, 2024 · 0 comments
Open

[R-package] Callback for change weights after iteration #6580

jaguerrerod opened this issue Jul 30, 2024 · 0 comments

Comments

@jaguerrerod
Copy link

Is there a way to change safely weights after each iteration based in some user custom logic?
This would be my use case:
A problem where the data is grouped by geographic area and the gradient boosting model consistently predicts some areas worse than others. I prefer to sacrifice some of the performance of the easier to predict zones in exchange for improving the predictions of the difficult zones, so reducing the variability of the errors per zone is a priority.
One approach is to fit a model and, based on the results, over-weight the 'difficult' regions, and do this several times.
What I want to do is introduce the process into the model fitting by doing upweighting after each iteration, evaluating all predictions by geographic area (the area is passed to dtrain with attr() and the performance of each area is assessed with a groupby on the absolute value of the prediction errors of the samples they include) and increasing the weight of the samples from the worst predicted areas.
It's the original idea of adaboost introduced into gradient boosting.

@jameslamb jameslamb changed the title Callback for change weights after iteration (in R) [R-package] Callback for change weights after iteration Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants