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

support base_margin for xgboost #309

Merged
merged 13 commits into from
Sep 6, 2024
Merged

support base_margin for xgboost #309

merged 13 commits into from
Sep 6, 2024

Conversation

bblodfon
Copy link
Contributor

Implement #205

@bblodfon
Copy link
Contributor Author

bblodfon commented Aug 22, 2024

https://xgboost.readthedocs.io/en/stable/tutorials/intercept.html#intercept => I think here it says that it can be used also for classif and that it can be also a matrix in case of multi-output/multi-class, I would just add it for binary classification so that the base_margin can be in there - @sebffischer what do you think?

@bblodfon
Copy link
Contributor Author

@adibender I have tested this, you change the base_margin response predictions do change

@bblodfon bblodfon changed the title support base_margin for regr.xgboost support base_margin for xgboost Aug 22, 2024
R/LearnerRegrXgboost.R Outdated Show resolved Hide resolved
R/LearnerRegrXgboost.R Outdated Show resolved Hide resolved
Copy link
Sponsor Member

@sebffischer sebffischer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how base_margin works, so I just assume this is correct. Just a minor detail about efficiency

@bblodfon
Copy link
Contributor Author

bblodfon commented Aug 22, 2024

@sebffischer I added support also for binary classification and tested it. Pretty much base_margin is a baseline/offset prediction where you "boost" from. For regression it's a continuous response, for binary classification it can be any vector again (user is responsible to denote which feature should be used and what values are inside there, eg if the feature has NAs, training won't work)

R/LearnerClassifXgboost.R Outdated Show resolved Hide resolved
R/LearnerClassifXgboost.R Outdated Show resolved Hide resolved
R/LearnerClassifXgboost.R Outdated Show resolved Hide resolved
inst/paramtest/test_paramtest_classif.xgboost.R Outdated Show resolved Hide resolved
@sebffischer sebffischer merged commit b58ba3b into main Sep 6, 2024
6 checks passed
@sebffischer sebffischer deleted the base_margin branch September 6, 2024 07:42
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

Successfully merging this pull request may close these issues.

2 participants