ModelOriented / shapper

An R wrapper of SHAP python library
https://modeloriented.github.io/shapper/
58 stars 14 forks source link

Using a custom model #22

Closed Jensxy closed 5 years ago

Jensxy commented 5 years ago

Is it possible to combine shapper with custom build models? I do not want to use a predefined algorithm like RandomForest.

agosiewska commented 5 years ago

Yes, of course. You just have to make sure, that you will provide a correct prediction function.

In the example here: https://modeloriented.github.io/shapper/reference/individual_variable_effect.html there is a random forest model, yet, you can use any model, just to parameter predict_function pass a function that takes model and data and return predictions.