TeamHG-Memex / eli5

A library for debugging/inspecting machine learning classifiers and explaining their predictions
http://eli5.readthedocs.io
MIT License
2.75k stars 331 forks source link

Error with explain_prediction_xgboost #335

Closed anthonymakela closed 5 years ago

anthonymakela commented 5 years ago

Hi! There seems to be a problem when trying to use the explain_prediction_xgboost function.

eli5.explain_prediction_xgboost(xgb_model, X_test.iloc[1], feature_names=list(X_test.columns), is_regression=True)

This produces the following warnings and returns nothing.

RuntimeWarning: invalid value encountered in true_divide covers /= np.sum(covers)

RuntimeWarning: invalid value encountered in greater num_positive = (x > 0).sum()

RuntimeWarning: invalid value encountered in greater pos_coef = coef > 0

RuntimeWarning: invalid value encountered in less neg_coef = coef < 0

What might be the cause of this?

Tried with xbgoost==0.90 and 0.6a2.

anthonymakela commented 5 years ago

Seem that the problem was due to xgboost version 0.90. After downgrading it to 0.81 everything worked as it should.