I'm trying to use shap on xgboost model, but getting error:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 341: invalid start byte
example:
model = XGBClassifier()
model.fit(X_train, y_train)
explainer = shap.TreeExplainer(model)
package versions:
python == 3.6.9
xgboost==1.1.0
shap==0.35.0
What is the problem and how can we fix it ?
There seems to be a bug in the system. See: https://github.com/slundberg/shap/issues/1215. The issue seems to be resolved, but perhaps the fix is not yet released. At any rate, I had the same issue and resolved it temporarily by installing xgboost v1.0.0.