|
30 | 30 | "outputs": [], |
31 | 31 | "source": [ |
32 | 32 | "# Data path\n", |
33 | | - "BASE_URL = \"https://d2hg8soec8ck9v.cloudfront.net/datasets/us_elections/\"" |
| 33 | + "BASE_URL = \"https://github.com/pyro-ppl/datasets/blob/master/us_elections/\"" |
34 | 34 | ] |
35 | 35 | }, |
36 | 36 | { |
37 | 37 | "cell_type": "code", |
38 | | - "execution_count": 4, |
| 38 | + "execution_count": null, |
39 | 39 | "metadata": {}, |
40 | 40 | "outputs": [ |
41 | 41 | { |
|
57 | 57 | "import torch\n", |
58 | 58 | "from urllib.request import urlopen\n", |
59 | 59 | "\n", |
60 | | - "electoral_college_votes = pd.read_pickle(urlopen(BASE_URL + \"electoral_college_votes.pickle\"))\n", |
| 60 | + "electoral_college_votes = pd.read_pickle(urlopen(BASE_URL + \"electoral_college_votes.pickle?raw=true\"))\n", |
61 | 61 | "print(electoral_college_votes.head())\n", |
62 | 62 | "ec_votes_tensor = torch.tensor(electoral_college_votes.values, dtype=torch.float).squeeze()" |
63 | 63 | ] |
|
106 | 106 | }, |
107 | 107 | { |
108 | 108 | "cell_type": "code", |
109 | | - "execution_count": 7, |
| 109 | + "execution_count": null, |
110 | 110 | "metadata": {}, |
111 | 111 | "outputs": [ |
112 | 112 | { |
|
125 | 125 | } |
126 | 126 | ], |
127 | 127 | "source": [ |
128 | | - "frame = pd.read_pickle(urlopen(BASE_URL + \"us_presidential_election_data_historical.pickle\"))\n", |
| 128 | + "frame = pd.read_pickle(urlopen(BASE_URL + \"us_presidential_election_data_historical.pickle?raw=true\"))\n", |
129 | 129 | "print(frame[[1976, 1980, 1984]].head())" |
130 | 130 | ] |
131 | 131 | }, |
|
652 | 652 | }, |
653 | 653 | { |
654 | 654 | "cell_type": "code", |
655 | | - "execution_count": 23, |
| 655 | + "execution_count": null, |
656 | 656 | "metadata": {}, |
657 | 657 | "outputs": [], |
658 | 658 | "source": [ |
659 | | - "test_data = pd.read_pickle(urlopen(BASE_URL + \"us_presidential_election_data_test.pickle\"))\n", |
| 659 | + "test_data = pd.read_pickle(urlopen(BASE_URL + \"us_presidential_election_data_test.pickle?raw=true\"))\n", |
660 | 660 | "results_2016 = torch.tensor(test_data.values, dtype=torch.float)\n", |
661 | 661 | "true_alpha = torch.log(results_2016[..., 0] / results_2016[..., 1])" |
662 | 662 | ] |
|
0 commit comments