Skip to content

update Moderation example to best practice and v4 #297

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 22 commits into from
Mar 20, 2022

Conversation

drbenvincent
Copy link
Contributor

Updates the moderation analysis example (see #170) to current best practice.

Because this is just a minor update with no substantive changes, I propose to speed things up that we don't necessarily need 2 reviewers. The only meaningful change was to shift all custom plot functions into a single (hidden) code cell.

Note: in pm.sample, I'm currently having to provide nuts={"target_accept": 0.9} rather than just target_accept=0.9 (see pymc-devs/pymc#5620)

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@drbenvincent drbenvincent requested a review from OriolAbril March 20, 2022 11:13
@online{vandenbergSPSS,
author = {van den Berg, R. G},
title = {SPSS Moderation Regression Tutorial},
year = XXXXX,
Copy link
Member

Choose a reason for hiding this comment

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

I think this is breaking the docs build. Can you try removing the year key altogether?

@review-notebook-app
Copy link

review-notebook-app bot commented Mar 20, 2022

View / edit / reply to this conversation on ReviewNB

OriolAbril commented on 2022-03-20T12:52:26Z
----------------------------------------------------------------

PyMC3 -> PyMC


drbenvincent commented on 2022-03-20T13:35:04Z
----------------------------------------------------------------

done

@review-notebook-app
Copy link

View / edit / reply to this conversation on ReviewNB

OriolAbril commented on 2022-03-20T12:52:27Z
----------------------------------------------------------------

PyMC3 -> PyMC


@review-notebook-app
Copy link

review-notebook-app bot commented Mar 20, 2022

View / edit / reply to this conversation on ReviewNB

OriolAbril commented on 2022-03-20T12:52:27Z
----------------------------------------------------------------

Line #2.        COORDS = {"obs": np.arange(len(x))}

There is no need to define coords with aranges in v4 provided they are first use (and can therefore be inferred automatically) in a Data object.


drbenvincent commented on 2022-03-20T13:35:29Z
----------------------------------------------------------------

have removed coords

Benjamin T. Vincent and others added 2 commits March 20, 2022 13:33
Copy link
Contributor Author

done


View entire conversation on ReviewNB

Copy link
Contributor Author

have removed coords


View entire conversation on ReviewNB

@drbenvincent
Copy link
Contributor Author

It's not adding the pm.* tags.

But docs now seems to work :)

@drbenvincent
Copy link
Contributor Author

Everything looks good, but still no pm.* tags

@OriolAbril
Copy link
Member

Everything looks good, but still no pm.* tags

I think we still need to update the style guide, but you can see that CI is passing without them. They should not be present anymore (and should be removed from the ones that have them).

@review-notebook-app
Copy link

review-notebook-app bot commented Mar 20, 2022

View / edit / reply to this conversation on ReviewNB

OriolAbril commented on 2022-03-20T16:29:34Z
----------------------------------------------------------------

I mentioned the explanation category in the myst view because its where I noticed, but I should probably done that here. if both files are updated without syncing them then only the changes in the most recent one are kept :/

The last paragraph about mediation analysis should also have a link to the mediation notebook (and viceversa I guess, not sure if the mediation has been updated already)


drbenvincent commented on 2022-03-20T17:14:09Z
----------------------------------------------------------------

Have attempted to cross reference the two notebooks

Copy link
Contributor Author

Have attempted to cross reference the two notebooks


View entire conversation on ReviewNB

@drbenvincent
Copy link
Contributor Author

Notebook cross references now work fine

@OriolAbril OriolAbril merged commit 951934a into pymc-devs:main Mar 20, 2022
@drbenvincent drbenvincent deleted the moderation-v4 branch March 20, 2022 17:41
@OriolAbril
Copy link
Member

Thanks! How has the extra myst step in pre-commit worked out for you?

@drbenvincent
Copy link
Contributor Author

For these kinds of small changes I don't think there was much difference. But I think it will definitely be more useful with larger changes. Better diff.

I was having some issues when running the pre commit on a target notebook:

Screenshot 2022-03-20 at 17 44 19

I ended up running pre-commit run --all

@OriolAbril
Copy link
Member

I have never tried that on specific files and the error doesn't make much sense to me, could it be because it was unstaged (before doing git add that then shows in git status in green)?

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.

2 participants