lime icon indicating copy to clipboard operation
lime copied to clipboard

number exception when using LIME with LightGBM native API

Open 123Kudo opened this issue 3 years ago • 0 comments

Situation:

  1. saving lime explainer using dill during training and loading it back during prediction.
  2. 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))

  1. 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:

  1. exception is a number 267 without other information

Any suggestion on where shall I dig into ?

123Kudo avatar Jul 06 '22 10:07 123Kudo