oegedijk / explainerdashboard

Quickly build Explainable AI dashboards that show the inner workings of so-called "blackbox" machine learning models.
http://explainerdashboard.readthedocs.io
MIT License
2.29k stars 331 forks source link

how to pass monotonic constraints to explainer? #241

Closed rdataforge closed 1 year ago

rdataforge commented 1 year ago

I use regression models, sometimes catboost sometimes xgboost. My models need a restriction on monotonicity for some features (monotone_constraints arg)

There is no parameter for this when declaring an explainer?

Thanks

oegedijk commented 1 year ago

Hi @rdataforge, could you clarify? Is this a parameter that you pass to the shap explainer? in that case you can pass it as a dict to shap_kwargs...

verajosemanuel commented 1 year ago

Hi, not really. Monotonicity is a restriction you pass to models. You set the direction of predictions to -1, 0 or +1 (down, nothing or up) when you expect a feature is related to prediction that way. Think on engine cv related to speed. That should be a +1 monotonicity restriction so the more horsepower the faster the car. https://xgboost.readthedocs.io/en/stable/tutorials/monotonic.html

oegedijk commented 1 year ago

Don't think this can be solved from the library side so closing for now..