-
-
Notifications
You must be signed in to change notification settings - Fork 272
Update GLM hierarchical & Robust Outlier Detection to best practices #147
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
Update GLM hierarchical & Robust Outlier Detection to best practices #147
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
There are some sns plot-related errors, due to the data type change. |
View / edit / reply to this conversation on ReviewNB OriolAbril commented on 2021-04-25T14:16:42Z I would use
CloudChaoszero commented on 2021-05-14T08:16:56Z Thanks! I wasn't able to get the contour colors though. :/ |
View / edit / reply to this conversation on ReviewNB OriolAbril commented on 2021-04-25T14:16:43Z Here I'd also use CloudChaoszero commented on 2021-05-02T09:55:00Z Hmm, how would I go about plotting these plot_pair visualizations on the same graph?
I tried doing the following, but it created "two graphs" that are not combined into one figure.
marginalKwards = {'kind': 'kde', 'color':sns.color_palette()[1]} az.plot_pair(trc_ols, var_names = fts, kind='scatter', contour= True, fill_last=True, divergences=True, figsize=[16,16], marginals=True, marginal_kwargs= marginalKwards, group='posterior' )
OriolAbril commented on 2021-05-04T11:52:21Z You need to do:
ax = az.plot_pair(...) az.plot_pair(..., ax=ax); CloudChaoszero commented on 2021-05-12T11:47:25Z Oh great, thanks for the tip!
|
As a general starting point, https://docs.pymc.io/notebooks/multilevel_modeling.html should be a good starting point to get plots to work. Also, can you add links to all 3 addressed issues? It's more important for me to keep track of the updates and their state to have links to the tracker issues than to #14 (which I may end up closing to reduce confusion) |
Hmm, how would I go about plotting these plot_pair visualizations on the same graph?
I tried doing the following, but it created "two graphs" that are not combined into one figure.
marginalKwards = {'kind': 'kde', 'color':sns.color_palette()[1]} az.plot_pair(trc_ols, var_names = fts, kind='scatter', contour= True, fill_last=True, divergences=True, figsize=[16,16], marginals=True, marginal_kwargs= marginalKwards, group='posterior' )
View entire conversation on ReviewNB |
Oh a tracker for the |
@CloudChaoszero I have updated the description to link to both relevant issues, I noticed that the PR is also modifying the hierarchcal binomial notebook but there are no changes it is only reexecuted. In fact you already updated it back in #45 so it's already in "Best Practices", I think the notebook should be excluded from this PR and work only on the other two. |
You need to do:
ax = az.plot_pair(...) az.plot_pair(..., ax=ax); View entire conversation on ReviewNB |
View / edit / reply to this conversation on ReviewNB OriolAbril commented on 2021-05-04T11:53:03Z Add a |
View / edit / reply to this conversation on ReviewNB OriolAbril commented on 2021-05-04T11:53:03Z Take a look at https://docs.pymc.io/notebooks/multilevel_modeling.html as a guide on how to perform the computations. Note that the current ones are actually wrong as they average first then operate when it should be the other way around. CloudChaoszero commented on 2021-05-14T08:17:26Z Thanks! I tried resolving this, and did such. However, some parts of the visualization are lost due to the change in data type. |
793ad90
to
37aeb6a
Compare
Oh great, thanks for the tip!
View entire conversation on ReviewNB |
I've updated examples/generalized_linear_models/GLM-hierarchical.ipynb
Will work on |
Thanks! I wasn't able to get the contour colors though. :/ View entire conversation on ReviewNB |
Thanks! I tried resolving this, and did such. However, some parts of the visualization are lost due to the change in data type. View entire conversation on ReviewNB |
View / edit / reply to this conversation on ReviewNB CloudChaoszero commented on 2021-05-22T09:04:17Z @OriolAbril would it be okay if this not contain the arrows & additional data points. Oddly, I'm stuck here and one other visualization... haha |
View / edit / reply to this conversation on ReviewNB OriolAbril commented on 2021-05-22T11:26:56Z I would use |
@CloudChaoszero it is hard to give better feedback without running the notebook myself and playing around a bit. Do you mind if I do that and push the changes afterwards? I can also try to live code and post a link here (I can't promise it will be anything worth watching though). Let me know how this sounds and if you like the idea we'll coordinate to avoid git conflicts and so on. |
@OriolAbril That works! Thanks a bunch, I really appreciate the help 🙏 |
Thank you @OriolAbril this works now. 🙏 ❤️ ( Seriously) |
Thanks @CloudChaoszero . Apologies for the delay in merging. |
This PR is the start of #14
Addresses #87 and #80 and updates the notebooks to "Best Practices"
Summary
return_inferencedata=True
.I'm open to interpretation on if this is what should be the goal for linked issue #14.