Combine InferenceData object
See original GitHub issueTell us about it
We should have the possibility to combine/merge inference data objects.
Thoughts on implementation
We could support both __add__
and specific function.
posterior = az.convert_to_inference_data({'mu' : np.array([...])}, "posterior")
posterior_predictive = az.convert_to_inference_data({'y_hat' : np.array([...])}, "posterior_predictive")
inference_data = posterior + posterior_predictive
inference_data = az.concat(posterior, posterior_predictive)
Easiest this would be if we by default support only combining individual groups (combine only if no groups overlap). We could also have a possibility to add chains/draws or both.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
ArviZ dev documentation - concat
Concatenate InferenceData objects. Concatenates over group , chain or draw . By default concatenates over unique groups. To concatenate ...
Read more >Combine Fit Objects - PyStan
Currently the easiest way is probably first to use az.from_pystan(posterior=fit) and then stacking arrays with numpy tools and recreating InferenceData object ...
Read more >Working with InferenceData — ArviZ 0.14.0 documentation
It has no effect on Dataset objects that already default to folded views. ... You can combine the two into a single InferenceData...
Read more >Create InferenceData from trace and sampled posterior ...
This example combines the trace (as a pm.MultiTrace ) and the posterior predictive samples (as a dict) into an arviz.InferenceData object ...
Read more >Docstrings · ArviZ.jl
dataA We have created an ``InferenceData`` object with default group 'posterior'. ... optional Which InferenceData data group to extract data from. combined ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Maybe. I don’t think we have not decided which structure is simple enough to be useful.
Partially closed by https://github.com/arviz-devs/arviz/pull/709
Other cases are “too hard” to have general solution.
For example, how should variables behave if they are missing the selected axis.
In future, if there is demand, we can create a convenience function to handle concat, where user supplied function is applied against all groups ::: not sure if this is really doable.