mlr-org / mlr3learners

Recommended learners for mlr3
https://mlr3learners.mlr-org.com
GNU Lesser General Public License v3.0
89 stars 14 forks source link

support base_margin for xgboost #309

Closed bblodfon closed 1 week ago

bblodfon commented 3 weeks ago

Implement https://github.com/mlr-org/mlr3learners/issues/205

bblodfon commented 3 weeks ago

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 commented 3 weeks ago

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

bblodfon commented 3 weeks ago

@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)