How can I plot a model, which is trained with a scaled dataset?

I have a major problem with XAI, Shap, Lime you name it in general. Here is a basic example for shap. My problem is that when I use a real tuned model, which is not a basic example, I always have a Scaler involved.

In the code below you see a dataset where I log the target and scale X to improve performance.

Of course these changed numericals are now delegated into the plot function of shap, but I don't want that, because it makes it harder to interpret the features. I would like to transform the annotations in the plots programmatically, so that y is back-transformed to its orginal self with np.expm1(X) for example. And the Inverse scaler is applied to all the other features.

I can't call the explainer directly with the original data, since the performance for a model trained on scaled values would be really bad obviously.

Is there any way to do this? Right now I am manually changing all plots by calculating it myself afterwards ...

# train an XGBoost model
X, y = shap.datasets.boston()
y = np.log1p(y)
model = xgboost.XGBRegressor()

pipeline = Pipeline(steps=[("scaler", RobustScaler()),                           
                           ('clf', model),
                          ])        
pipeline.fit(X, y)
# explain the model's predictions using SHAP
explainer = shap.Explainer(pipeline["clf"])
shap_values = explainer(pipeline["scaler"].fit(X))

# visualize the first prediction's explanation
shap.plots.waterfall(shap_values[0])
How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum