Skip to content

Commit

Permalink
ready for post
Browse files Browse the repository at this point in the history
  • Loading branch information
wmentrekin committed Oct 29, 2020
1 parent 45e7316 commit 1ee746e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Model.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,12 +614,13 @@ def write_results():

#Create HTML Table for Full Results
results = []
results_fields = ['State', 'Trump Projected Vote', 'Biden Projected Vote', 'Projected Margin', 'Trump Chance', 'Biden Chance']
results_fields = ['State', 'Projected Winner', 'Trump Projected Vote', 'Biden Projected Vote', 'Projected Margin', 'Trump Chance', 'Biden Chance']
results.append(results_fields)
results_rows = []
for state in State.states:
row = []
row.append(state.name)
row.append(state.simulations['winner'])
row.append(str(state.simulations['vote_pct_r']) + '%')
row.append(str(state.simulations['vote_pct_d']) + '%')
row.append(str(state.simulations['margin']) + '%')
Expand Down
8 changes: 4 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ <h1>Methods</h1>
<section>
<p>
<b>Disclaimer</b>: This model is not an official prediction. I am in no way attesting to its potential accuracy or claiming it to be correct.
The point of this project was to be a learning exercise for me as well as an outlet for an interest of mine. The data you see here is purely a result
of my model and I am not in any way a professional election forecaster. Nonetheless, I hope this peaks your interest.
The point of this project was to be a learning exercise for me as well as an outlet for an interest of mine. I am not in any way a professional election forecaster.
Nonetheless, I hope this peaks your interest.
</p>
<p>
When I first decided to begin working on this model in August, I wanted to challenge myself to learn more about different Python libraries,
such as Scipy, Numpy, Pandas, and Matplotlib and to see if I could come up with anything accurate at all. I utilized my prior skills in webscraping
such as Scipy, Numpy, Pandas, and Matplotlib and to see if I could come up with anything accurate. I utilized my prior skills in webscraping
and data manipulation while using new knowledge in statistics and data visualization. The entire model is written in Python.
</p>
<p>
Expand All @@ -97,7 +97,7 @@ <h1>Methods</h1>
to implement this model. The model thus breaks down into these parts: correcting polls based on the grade and historical bias of their pollsters,
aggregating polls in each state into a singular rating with a vote share for both candidates and margin of error based on the combined margins of all the polls
(for states with no polling data, this rating was simply based on the 2016 election results, as states with no polling data are not assumed to be competitive
or chance much in their results from the prior election cycle), combining the prior election results and the ratings for each state into distributions of possible vote share
or change much in their results from the prior election cycle), combining the prior election results and the ratings for each state into distributions of possible vote share
for each candidate in each state, simulating 10,000 races in each state, and visualizing the data with the map and graphs you see below.
</p>
</section>
Expand Down

0 comments on commit 1ee746e

Please sign in to comment.