-
-
Notifications
You must be signed in to change notification settings - Fork 984
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
Election tutorial #2041
Election tutorial #2041
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is great! some initial comments/questions:
- @neerajprad should we move this data files (*.pickle) somewhere else?
- @neerajprad what's the optimal way to link to the other OED tutorial?
- at the top add some caveat about "We make a number of simplifying assumptions... exploratory..."?
- "We will take historical election data 19760-2012 as our prior" => "We will use historical election data 1976-2012 to construct a plausible prior"
- print out some of the dataframes instead of the whole thing where appropriate?
- explain why your covariance is in logits space
- missing word "we are assuming that people respond to the ...."
- "# Now compute w according to the (approximate) electoral college formula" pull this deterministic calculation out as a helper function?
- strange comment? " (This kind of posthoc analysis is, of course, only engaged in by people of low statistical morals.)"
- "One such variational estimator is " + "the"
- "This
$q$ performs" arguably q doesn't perform anything although it might be used to perform something? - can you call the intermediates in
compute_dem_probability
h1, h2 etc - re: "def h(p)" why not use bernoulli.entropy
- explain
swing_score
- why
eig=False
and use of ape? - why do the code snippet that starts
best_eig = 0
programmatically? - i'm confused by what's going on in the second-to-last section
- the final sentence reads a bit wonky
Even though these are small binaries, we should upload it to aws like other datasets and read it from there, rather than committing it in this PR.
For the time being, how about just directing to the github link? Once this is published, we can change those links to direct to the website. |
look at the links in the other intro tutorials. iirc a normal md link should work |
@ae-foster when you get to this let's also fix the formatting errors in http://pyro.ai/examples/working_memory.html |
…ist in working mem tutorial
I've gone through and applied @martinjankowiak 's suggestions.
Since
I rewrote this section- have a look and see if it is better
I take it you guys have to do that as you have the necessary AWS keys
I'm sticking with this then
The only one I could see was a malformed numbered list near the beginning- I tried to fix this by throwing in some extra new lines. Hard to tell how it'll render though. Were there other formatting errors we need to pick up? |
@neerajprad can you please help get the pickle files in this PR onto aws? |
@ae-foster looks good.
|
Just pushed some more updates.
I went through the existing tutorial online and picked up a few other changes which are fixed now
I had another go at rewriting and simplifying this section. The general point is: having done the experimental design, let's simulate actually running the experiment and conducting the data analysis: have a look at the posterior compared to the prior. Nothing really intellectual here, just showing the complete experiment loop. If you think it's still confusing it's no problem to drop this section altogether.
I've added explanation as comments near where I put Overall, I think the tutorial is looking close to ready now. Did you get the files up on AWS? |
Codecov Report
@@ Coverage Diff @@
## dev #2041 +/- ##
======================================
Coverage ? 94.47%
======================================
Files ? 201
Lines ? 12781
Branches ? 0
======================================
Hits ? 12075
Misses ? 706
Partials ? 0 Continue to review full report at Codecov.
|
looking great. a few last nits:
i'll let you know once we have the AWS pickles sorted |
@ae-foster, @martinjankowiak - The dataset files should be in https://d2hg8soec8ck9v.cloudfront.net/datasets/us_elections/ directory on aws. |
Thanks- I've sorted those comments from @martinjankowiak and I have removed the data from the repo, instead we now have
which should download the data to the right directory at the start |
great thanks @ae-foster ! can you please make the data downloading pythonic? see e.g. here |
Now using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great, thanks adam! i'll merge this as is although i notice some of the numbers have shifted a bit. did something change, is this just inherent stochasticity, or do things need to be trained for longer or what?
It's inherently stochastic because it depends on the simulated outcome of the experiment |
Here is the second tutorial for pyro.contrib.oed.
In this tutorial, we introduce the posterior estimator and show how it could be used to design a polling strategy that can lead to accurate predictions of the outcome of a US presidential election.