Skip to content

Add ArviZ InfData Blog post #405

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 50 commits into from
May 10, 2023
Merged

Add ArviZ InfData Blog post #405

merged 50 commits into from
May 10, 2023

Conversation

canyon289
Copy link
Contributor

@canyon289 canyon289 commented Dec 18, 2022

Creating a pr so the ArviZ team can review and edit first.
Will request review from xarray team when ArviZ review complete

ArviZ Devs see this for reference https://xarray.dev/blog/introducing-pint-xarray

Fixes #348

@vercel
Copy link

vercel bot commented Dec 18, 2022

@canyon289 is attempting to deploy a commit to the xarray Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Dec 19, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
xarray-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 9, 2023 10:50pm

Copy link
Contributor

@jhamman jhamman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great start here!

@canyon289
Copy link
Contributor Author

@jhamman thanks much for this early review. Its still a bit work in progress, I hope you didn't mind 😓

I'll fix this up over this week, and ask a couple of ArviZ devs to give it a look through before asking for a final review.

Hope you have a great holiday

canyon289 and others added 22 commits January 7, 2023 18:08
Co-authored-by: Joe Hamman <jhamman1@gmail.com>
Co-authored-by: Joe Hamman <jhamman1@gmail.com>
Co-authored-by: Joe Hamman <jhamman1@gmail.com>
Co-authored-by: Joe Hamman <jhamman1@gmail.com>
Co-authored-by: Joe Hamman <jhamman1@gmail.com>
Co-authored-by: Osvaldo A Martin <aloctavodia@gmail.com>
Co-authored-by: Osvaldo A Martin <aloctavodia@gmail.com>
Co-authored-by: Osvaldo A Martin <aloctavodia@gmail.com>
Co-authored-by: Osvaldo A Martin <aloctavodia@gmail.com>
Co-authored-by: Osvaldo A Martin <aloctavodia@gmail.com>
Co-authored-by: Osvaldo A Martin <aloctavodia@gmail.com>
Co-authored-by: Osvaldo A Martin <aloctavodia@gmail.com>
Co-authored-by: Osvaldo A Martin <aloctavodia@gmail.com>
Co-authored-by: Osvaldo A Martin <aloctavodia@gmail.com>
Co-authored-by: Oriol Abril-Pla <oriol.abril.pla@gmail.com>
Co-authored-by: Osvaldo A Martin <aloctavodia@gmail.com>
Copy link
Contributor

@jhamman jhamman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is super close. I changed the published date to next week. Can we make that happen?

@@ -0,0 +1,114 @@
---
title: 'Better Bayesian Workflows with InferenceData and Xarray'
date: '2022-12-17'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
date: '2022-12-17'
date: '2023-03-06'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! Love the enthusiasm

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pick a new day and we'll work to make it happen!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Suggested change
date: '2022-12-17'
date: '2023-03-14'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Suggested change
date: '2022-12-17'
date: '2023-03-21'

@OriolAbril think we can get this done in the next two days?

import arviz as az

data = az.load_arviz_data("centered_eight")
data
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we show the repr for this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The repr is not very informative, it will look like:

Inference data with groups:
	> posterior
	> posterior_predictive
	> log_likelihood
	> sample_stats
	> prior
	> prior_predictive
	> observed_data
	> constant_data

If possible though, the html_repr is much more informative (built on top of the dataset one), it is the output of the 2nd code cell in https://python.arviz.org/en/stable/getting_started/WorkingWithInferenceData.html.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should be able to put the html repr in the post.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@OriolAbril I think we could show both the inferencedata repr, and then the repr of one of the groups, which is just an xarray repr. What do you think? Would that better highlight now the two are related?

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is simpler to use the inferencedata html repr directly, omce any of the groups is expanded it becomes clear and explicit they are xarray.Dataset objects

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really want to get this over the line. What does it take? Should I copy the html from here?

https://python.arviz.org/en/stable/getting_started/XarrayforArviZ.html#an-introduction-to-each

is it a matter of copying it from the static notebook in github, or do I need to do it from jupyter?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HTML as been added

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i just pushed a few changes with support of HTML repr. this is now working: https://xarray-dev-git-fork-canyon289-infdata-xarray.vercel.app/blog/introducing-inference-data

Screenshot 2023-05-09 at 17 06 49

Co-authored-by: Joe Hamman <jhamman1@gmail.com>
OriolAbril and others added 6 commits May 5, 2023 17:27
@canyon289
Copy link
Contributor Author

canyon289 commented May 5, 2023

@jhamman @andersy005 Oriol and I finally did it we believe. We can't see the preview so we hope the html is good. Let us know if you see anything from your own

@jhamman
Copy link
Contributor

jhamman commented May 5, 2023

Thanks @canyon289 - I'll try to get this reviewed today and we can aim to publish early next week.

@andersy005
Copy link
Member

@jhamman, this is ready for another round of review...

@canyon289, thank you very much for your patience! excited to see this completed soon

Copy link
Contributor

@jhamman jhamman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One copy edit issue for @canyon289 to look at but otherwise, this is ready to go!

Comment on lines 79 to 81
Importantly they also remove implicit assumptions of which dimension represents chains and draws,\
dimensions while necessary for sampling, are not so interesting when trying to perform inference,
similar to how batch dimensions are a computational nuance, but not a modeling nuance.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something seems off here but I'm not sure how to edit it appropriately.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reedited it, let me know if you like how it sounds now

@jhamman jhamman merged commit b40206e into xarray-contrib:main May 10, 2023
@jhamman
Copy link
Contributor

jhamman commented May 10, 2023

This was an epic! Thanks for the contribution @canyon289, @aloctavodia, and @OriolAbril!

And thanks to @dcherian and @andersy005 for the support/reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[User story proposal] Xarray for Bayesian modeling (PyMC, ArviZ)
6 participants