question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Combine InferenceData object

See original GitHub issue

Tell 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:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ahartikainencommented, Mar 9, 2019

Maybe. I don’t think we have not decided which structure is simple enough to be useful.

0reactions
ahartikainencommented, Jun 21, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found