I'm using GPUTree and found mismatches between GPUTree and TreeExplainer:
Tree Explainer Code:
explainer = shap.TreeExplainer(model)
shap_values_per_entity = explainer.shap_values(x_predict)
GPUTree Explainer Code:
explainer = shap.explainers.GPUTree(model)
shap_values_per_entity = explainer.shap_values(x_predict)
model = lgbm
When I'm using the GPUTree Explainer Code I'm getting the following exception (while using the Tree explainer for the same model and prediction I got the shape values without any exceptions): Additivity check failed in TreeExplainer! Please ensure the data matrix you passed to the explainer is the same shape that the model was trained on. If your data shape is correct then please report this on GitHub. Consider retrying with the feature_perturbation='interventional' option. This check failed because for one of the samples the sum of the SHAP values was -0.036761, while the model output was -1.979285. If this difference is acceptable you can set check_additivity=False to disable this check. In addition, this exception is unclear since the prediction is different from the one that I used in order to train the model.
following the previous error I ran the shap_values function with the flag check_additivity=False:
shap_values_per_entity = explainer.shap_values(x_predict,check_additivity=False) and the results I got is different from the result I got for TreeExplainer, for example:
Tree shap results:
0.000679,-0.000121,0.000143,0.000715,0.0
Gpu tree shap results:
0.00478, -0.000650, 0.000106, 0.000587, 0.0