What is the final value in XGBoosterPredictFromDMatrix type 2 ("predict contribution")?

Hello! When I call XGBoosterPredictFromDMatrix [1] with “type”: 2 in the JSON to predict contributions, the output vector has one contribution for each feature, and one “extra” value per row. (I haven’t checked that execution passes through the line cited, but it seems plausible this is the line that indicates there is an extra contribution predicted [2]).

What is this extra value? What does it mean? I followed some of the code starting from [2], but wasn’t able to easily figure out what this value is used for.

[1] https://xgboost.readthedocs.io/en/stable/dev/c__api_8h.html#a843f60933367fb27e78dc49bdbbe9f32
[2] https://github.com/dmlc/xgboost/blob/master/src/predictor/cpu_predictor.cc#L426

1 Like