This repository contains Python code for predicting COVID-19 cases at the county level in the US, utilizing a stacked Long Short-Term Memory (LSTM) neural network.
To install and run the code, ensure the following packages are installed:
tensorflow (tf-gpu)
pandas
geopandas
scikit-learn
kerasIf you use this code, please cite the following papers:
-
Lucas, B., Vahedi, B., & Karimzadeh, M. (2022).
A spatiotemporal machine learning approach to forecasting COVID-19 incidence at the county level in the USA.
International Journal of Data Science and Analytics, 1-20.
Publisher: Springer.@article{lucas2022covidlstm, title={A spatiotemporal machine learning approach to forecasting COVID-19 incidence at the county level in the USA}, author={Lucas, Benjamin and Vahedi, Behzad and Karimzadeh, Morteza}, journal={International Journal of Data Science and Analytics}, pages={1--20}, year={2022}, publisher={Springer} }
-
Vahedi, B., Karimzadeh, M., & Zoraghein, H. (2021).
Predicting County-Level COVID-19 Cases using Spatiotemporal Machine Learning: Modeling Human Interactions using Social Media and Cell-Phone Data.
(Manuscript in preparation)@article{vahedi2021predicting, title={Predicting County-Level COVID-19 Cases using Spatiotemporal Machine Learning: Modeling Human Interactions using Social Media and Cell-Phone Data}, author={Vahedi, Behzad and Karimzadeh, Morteza and Zoraghein, Hamidreza}, year={2021} }
To generate COVID-19 case predictions:
-
Open the
codefolder in the command line. -
Run the following command, specifying the desired forecast date (must be a Sunday):
python3 run_forecast.py -d YYYY-MM-DD
Example:
python3 run_forecast.py -d 2020-12-27
-
Wait approximately 30-40 minutes for the forecast to complete.
-
Once complete, check the
resultsfolder for the output CSV file. The file contains county-level case predictions for 1-, 2-, 3-, and 4-week horizons, following the COVID-19 ForecastHub submission guidelines.
Note: The forecast date must be a Sunday in accordance with the submission guidelines of the COVID-19 ForecastHub.
This work was supported by:
- The Population Council
- The University of Colorado Population Center (CUPC), funded by the Eunice Kennedy Shriver National Institute of Child Health & Human Development (P2CHD066613).
The content is solely the responsibility of the authors and does not necessarily represent the official views of the Population Council, the NIH, CUPC, or the University of Colorado.