DiCE icon indicating copy to clipboard operation
DiCE copied to clipboard

Support for scikit-learn and other libraries where models are not necessarily differentiable

Open drishyamlabs opened this issue 4 years ago • 5 comments

Hi, Thanks a lot for the wonderful library. As you guys have mentioned in the roadmap, can you tell us by when we can expect the integration of scikit-learn like libraries. I am facing issues when using trying to integrate the same. Thanks in advance!

drishyamlabs avatar Oct 26 '20 08:10 drishyamlabs

yes, integrating scikit-learn is a high-priority feature and we are working on it. Should have an update in the next few weeks.

amit-sharma avatar Oct 29 '20 09:10 amit-sharma

Hi, thanks for a cool and important library. Can you please tell whether LightGBM will be supported after a new updates?

arsine1996 avatar Nov 09 '20 10:11 arsine1996

Hi @arsine1996, we are currently trying to make it work for scikit-learn models. We will update the readme if we can extend it to XGBoost and LightGBM as well.

raam93 avatar Dec 07 '20 10:12 raam93

@raam93 I'm also interested in using LightGBM, XGBoost etc. I found currently DiCE supports 'scikit-learn' model DiCE_model_agnostic_CFs.ipynb. Does it also support LightGBM scikit-learn API ?

konabuta avatar Apr 13 '21 08:04 konabuta

@konabuta DiCE supports any ML model that respects the scikit-learn API for predict and predict_proba. So if your model has these two functions, you can use it with the "sklearn" backend. I think LightGBM uses an API that is compatible with scikit-learn, so I think it should work.

Just use the backend="sklearn" and input the lightgbm model. It may work with XGBoost too.

For any model, you can have a look at this file: https://github.com/interpretml/DiCE/blob/master/dice_ml/model_interfaces/base_model.py As long as your model has a predict and predict_proba function, it should work directly.

amit-sharma avatar May 06 '21 11:05 amit-sharma