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.3k stars 332 forks source link

[QUESTION] - Is there any way to inverse_transform numerical features by providing preprocessor object? #231

Closed fjpa121197 closed 2 years ago

fjpa121197 commented 2 years ago

Hi,

I'm currently using ExplainerDashboard with a Bayesian Ridge model, and I have been able to set it up and run without a problem.

However, I noticed the scale of my numerical features is different, since I'm using a RobustScaler for them and therefore the ranges shown in the feature input section uses the ranges used to train the model. However, if I wanted to change the input of one instance, I will need to transform that new input value, so it is the same scale.

image

Is there any way to provide the preprocessor (that uses the RobustScaler)?

I was thinking that a solution will be to inverse transform my numerical features before passing it to explainer, however, not sure if the predictions are being generated in the run, and if this is the case, by seeing the original unscaled input, the model will give total different predictions.

Thanks

fjpa121197 commented 2 years ago

@oegedijk

fjpa121197 commented 2 years ago

Closing issue because I was able to solve problem, by not scaling numerical features (with minimal effect on performance).

However, it will be nice to implement, or allow to pass a Pipeline/Columntransformer object to handle this in the background.