Support adaptive tree, a feature supported by both sklearn and lightgbm. The tree leaf is recomputed based on residue of labels and predictions after construction. For l1 error, the optimal value is the median (50 percentile). This is marked as experimental support for the following reasons: - The value is not well defined for distributed training, where we might have empty leaves for local workers. Right now I just use the original leaf value for computing the average with other workers, which might cause significant errors. - Some follow-ups are required, for exact, pruner, and optimization for quantile function. Also, we need to calculate the initial estimation.
XGBoost Plugin Example
This folder provides an example of implementing xgboost plugin.
There are three steps you need to do to add a plugin to xgboost
- Create your source .cc file, implement a new extension
- In this example custom_obj.cc
- Register this extension to xgboost via a registration macro
- In this example
XGBOOST_REGISTER_OBJECTIVEin this line
- In this example
- Add a line to
xgboost/plugin/CMakeLists.txt:
target_sources(objxgboost PRIVATE ${xgboost_SOURCE_DIR}/plugin/example/custom_obj.cc)
Then you can test this plugin by using objective=mylogistic parameter.