Sequential Vote Results of Swiss Referenda
- 1. ETHZ
- 2. EPFL
Description
This repo contains the data introduced in
Immer, A.*, Kristof, V.*, Grossglauser, M., Thiran, P., Sub-Matrix Factorization for Real-Time Vote Prediction, KDD 2020
These data have been collected from OpenData.Swiss every two minutes on two different referendum vote days: May 19, 2019, and February 9, 2020. We use these data to make real-time predictions of the referenda outcome on www.predikon.ch. We publish here the raw data, as retrieved in JSON format from the API. We also provide a python script to help scraping the JSON files.
After unzipping the datasets, you can scrape the data by referendum vote day by doing:
from scraper import scrape_referenda
# Scrape the data from February 2, 2020.
data_dir = 'path/to/2020-02-09'
data = scrape_referenda(data_dir)
The data variable will be a list of datum dictionaries of the following structure:
{
"vote": 6290,
"municipality": 1,
"timestamp": "2020-02-09T15:23:10",
"num_yes": 222,
"num_no": 482,
"num_valid": 704,
"num_total": 709,
"num_eligible": 1407,
"yes_percent": 0.3153409090909091,
"turnout": 0.503909026297086
}
The datum is as follows:
- vote: vote ID as defined by OpenData.Swiss
- municipality: municipality ID as defined by OpenData.Swiss
- timestamp: date and time at which the JSON files has been published on OpenData.Swiss
- num_yes: number of "yes" in the municipality
- num_no: number of "no" in the municipality
- num_valid: number of valid ballots (the ones counting for the results)
- numb_total: total number of ballots (including invalid ones)
- num_eligible: number of registered voters
- yes_percent: percentage of "yes" (computed as `num_yes / num_valid`)
- turnout: turnout to the vote (computed as `num_total / num_eligible`)
Don't hesitate to reach out to us if you have any questions!
To cite this dataset:
@inproceedings{immer2020submatrix,
author = {Immer, Alexander and Kristof, Victor and Grossglauser, Matthias and Thiran, Patrick},
title = {Sub-Matrix Factorization for Real-Time Vote Prediction},
year = {2020},
booktitle={Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery \& Data Mining},
}
Files
2019-05-19.zip
Additional details
Related works
- Is compiled by
- Conference paper: 10.1145/3394486.3403277 (DOI)
References
- Immer, A.*, Kristof, V.*, Grossglauser, M., Thiran, P., Sub-Matrix Factorization for Real-Time Vote Prediction, KDD 2020