Scikit-learn API GPU-Accelerated SHAP values

Hi :wave:,

following discussions from 1 and 2 try to speed-up how shap values are calculated. Using shap.TreeExplainer from Shap library it takes 1.5 hours to process a dataframe of shape 50M rows and 10 columns.

Tested with limited success
deval = xgb.DMatrix(X_eval, label=y_eval)
clf.get_booster().set_param({‘predictor’: ‘gpu_predictor’})
shap_values = clf.get_booster().predict(deval, pred_contribs=True)

Any help would be greatly appreciated.

  1. https://github.com/dmlc/xgboost/blob/master/demo/gpu_acceleration/shap.ipynb
  2. https://discuss.xgboost.ai/t/shap-values-not-adding-up-to-margin-values/808

Did you try running the notebook https://github.com/dmlc/xgboost/blob/master/demo/gpu_acceleration/shap.ipynb? Did it work?

We don’t yet support GPU-accelerated SHAP in the scikit-learn API. You will want to use xgboost.train API.

Hi @hcho3, thanks for your timely response.

Noticed GPU SHAP values feature starts from release 1.3.0. I’ll give it a shot to that notebook you shared.

Best!