bgreenwell / fastshap

Fast approximate Shapley values in R
https://bgreenwell.github.io/fastshap/
116 stars 18 forks source link

Missing object 'phis' #79

Open T7963 opened 2 months ago

T7963 commented 2 months ago

I'm trying to use fastshap for the analysis of the prediction of an elastic neural network with 3 outputs. The wrapper function is designed for one of the outputs and generating a numeric vector in the correct way. However, following prediction the error message "object 'phis' not found" is reported. The enviroment is: R4.1.1, Keras3, Tensorflow 2.17, module shap imported with reticulate::py_install("shap")

explainer_Y1 <- fastshap::explain( loaded_model, baseline = baseline, X = x_train_reshaped_2d, pred_wrapper = function(object, newdata) predict_wrapper(object, newdata, "Y1"), nsim = 300, adjust = TRUE ) I modified adjust and baseline as well. Every possible combination fails.

bgreenwell commented 1 week ago

Sorry for the delay @T7963, I will try to take a look. Do you have a reprex I can run on my end?