Skip to content

Update notebooks with current API #1445

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 4 commits into from
Oct 18, 2016
Merged

Conversation

ColCarroll
Copy link
Member

Mostly making sure imports still worked, restarting kernels and running the code all the way through. Did not check much for accuracy or soundness of approaches.

The only substantive change was in trace_to_dataframe, which now includes transformed variables. One of the notebooks requires this to run, and it made sense to me that a user can filter columns more easily than recreating the dropped ones, but I can revert that if there are objections.

This was all run in python 3.5, using the environment we build on travis, with a few extra libraries installed manually if the notebook required it.

Fixes #1444 , except for pmf-pymc, which has a separate issue (#830).

" s = GaussianRandomWalk('s', sigma ** -2, shape=n)\n",
"\n",
" r = StudentT('r', nu, lam=exp(-2 * s), observed=returns)\n",
" r = StudentT('r', nu, lam=np.exp(-2 * s), observed=returns)\n",
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't that be pymc3.math.exp?

flat_names = {v: create_flat_names(v, shape)
for v, shape in var_shapes.items()
if not v.endswith('_')}
flat_names = {v: create_flat_names(v, shape) for v, shape in var_shapes.items()}
Copy link
Member

Choose a reason for hiding this comment

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

Is this reverting #1367? Why?

Copy link
Member

Choose a reason for hiding this comment

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

Ah, you mentioned that. Perhaps we can add a kwarg like hide_transformed_vars?

@@ -23,11 +23,11 @@ def trace_to_dataframe(trace, chains=None, flat_names=None):
if flat_names is None:
flat_names = {v: create_flat_names(v, shape)
for v, shape in var_shapes.items()
if not v.endswith('_')}
if not hide_transformed_vars or not v.endswith('_')}
Copy link
Member

Choose a reason for hiding this comment

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

equivalent to the more readable: if not (hide_transformed_vars and v.endswith('_'))

Copy link
Member

Choose a reason for hiding this comment

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

@ColCarroll If you changes this we can merge this.

@ColCarroll
Copy link
Member Author

Missed that one, sorry!

@twiecki twiecki merged commit f1e622f into pymc-devs:master Oct 18, 2016
@twiecki
Copy link
Member

twiecki commented Oct 18, 2016

👍

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.

3 participants