arviz icon indicating copy to clipboard operation
arviz copied to clipboard

[Feature Request] Allow `transform` to support a dictionary

Open omrihar opened this issue 2 years ago • 1 comments

First off, thanks for the great project! I love it!

I often use pymc to fit GLMs with a log-link function. This means that I frequently am interested in transforming some of the variables, but not others, by applying np.exp in the plots. In order to do this I usually would then need to plot separately the log-transformed variables and those that are not. I think it would be great if transform supported a dictionary syntax, for example the following:

az.plot_forest(inference_data, transform={'α': np.exp})

Now I would do something like:

az.plot_forest(inference_data, var_names='α', transform=np.exp)
# ...
az.plot_forest(inference_data, var_names=['γ', 'σ'])

Thanks!

If there is interest in this feature I'm willing to try to implement this, but may take me a while, time permitting...

omrihar avatar Sep 18 '22 07:09 omrihar

Hello, I want to help implementing this feature

LuchoCateura avatar Sep 26 '22 13:09 LuchoCateura