komiya-atsushi / xgboost-predictor-java

Pure Java implementation of XGBoost predictor for online prediction tasks.
Apache License 2.0
339 stars 108 forks source link

predict contributions #25

Closed bryan-woods closed 6 years ago

bryan-woods commented 6 years ago

Are there plans to add support for predicting feature contributions. From the python documentation:

pred_contribs (bool) – When this option is on, the output will be a matrix of (nsample, nfeats+1) with each record indicating the feature contributions (SHAP values) for that prediction. The sum of all feature contributions is equal to the prediction. Note that the bias is added as the final column, on top of the regular features.

bryan-woods commented 6 years ago

I did a little more digging. This functionality is definitely missing in this library, but exists in the core XGBoost library in their PredictContribution function in cpu_predictor.cc

bryan-woods commented 6 years ago

This is a duplicate of https://github.com/komiya-atsushi/xgboost-predictor-java/issues/20