lime
lime copied to clipboard
number exception when using LIME with LightGBM native API
Situation:
- saving lime explainer using dill during training and loading it back during prediction.
- the model is light gbm native api predict - so wrapped it as below
def predict_fn(x): p = gbm.predict(x).reshape(-1, 1) return np.hstack((1-p, p))
- use it as below within a try except block
test = explain_df.iloc[0, :].values logger.info(test.shape) exp = explainer.explain_instance(test, predict_fn)
Exception:
- exception is a number 267 without other information
Any suggestion on where shall I dig into ?