Closed jttoivon closed 2 years ago
Hi @jttoivon, your prediction wrapper needs to be updated. For randomForest()
, you need to supply newdata
, as opposed to just data
(the latter is used by ranger's predict()
method. Make that change and it works just fine, but explaining 3000 instances using 100 Monte Carlo reps will still be expensive to compute. Also, since you loaded the packages at the top, you don'd need to use ::
to access any of those packages functions.
It works! Thanks for the quick reply and great package!
PS. I use verbose style as a documentation, where I always include every package with 'library', even though I sometimes specify the namespace explicitly, for example when the same function exists in several packages, or for a reminder for myself which package defines a rarely used function.
Jarkko
I tried to modify the simple example from fastshap webpage so that it would use randomForest instead of ranger. However, the returned shap values are all zero. What could be wrong? The slightly modified example program is below.
Jarkko