giuseppec / iml

iml: interpretable machine learning R package
https://giuseppec.github.io/iml/
Other
489 stars 88 forks source link

Lime is not working #167

Open nilover opened 3 years ago

nilover commented 3 years ago

Hi, I am using mlr and iml to build an interpretable prediction model using xgboost. I tried Lime as well as shapley to extract the interpretable feature score (Lime) and phi values (Shapley).

mod_lime.explain = LocalModel$new(mod_predictor, 
+                                  x.interest = data_X[1,],
+                                  k= total_num_features)

Error in lognet(x, is.sparse, ix, jx, y, weights, offset, alpha, nobs,  : 
  NA/NaN/Inf in foreign function call (arg 5)
mod_shapley = Shapley$new(mod_predictor, 
                                                  x.interest = data_X[1,])
plot(mod_shapley)

Thank you very much for the help.

christophM commented 3 years ago

The error seems like there is some trouble fitting the LIME regression model. Could you provide a reproducible example? Without one I can't say why the error occurs.