{"id":19234087,"url":"https://github.com/datpham0412/covid19-prediction-model","last_synced_at":"2025-04-21T05:30:26.986Z","repository":{"id":245975785,"uuid":"818090525","full_name":"datpham0412/covid19-prediction-model","owner":"datpham0412","description":"Machine learning project aimed at predicting new COVID-19 cases using historical COVID-19 and mobility data. The project involves data fetching, migration, preprocessing, exploratory data analysis (EDA), feature engineering, data splitting, model training, and evaluation. ","archived":false,"fork":false,"pushed_at":"2025-03-04T11:36:27.000Z","size":11004,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-01T09:52:26.490Z","etag":null,"topics":["cmake","cplusplus-17","dill","googletest","jupyter-notebook","matplotlib","pandas","python3","scikit-learn","scikitlearn-machine-learning","seaborn-python","sqlite"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datpham0412.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-21T04:49:30.000Z","updated_at":"2025-03-04T11:36:31.000Z","dependencies_parsed_at":"2024-06-25T05:51:57.001Z","dependency_job_id":"9797c60f-f1f4-4216-aa56-b59a325cd2b1","html_url":"https://github.com/datpham0412/covid19-prediction-model","commit_stats":null,"previous_names":["datpham0412/covid19_prediction_model"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datpham0412%2Fcovid19-prediction-model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datpham0412%2Fcovid19-prediction-model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datpham0412%2Fcovid19-prediction-model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datpham0412%2Fcovid19-prediction-model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datpham0412","download_url":"https://codeload.github.com/datpham0412/covid19-prediction-model/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250002111,"owners_count":21359046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cmake","cplusplus-17","dill","googletest","jupyter-notebook","matplotlib","pandas","python3","scikit-learn","scikitlearn-machine-learning","seaborn-python","sqlite"],"created_at":"2024-11-09T16:12:44.267Z","updated_at":"2025-04-21T05:30:26.975Z","avatar_url":"https://github.com/datpham0412.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🦠 Covid 19 Prediction Model\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/datpham0412/Covid19_Prediction_Model/blob/main/LICENSE)\n[![GitHub issues](https://img.shields.io/github/issues/datpham0412/Covid19_Prediction_Model)](https://github.com/datpham0412/Covid19_Prediction_Model/issues)\n[![GitHub stars](https://img.shields.io/github/stars/datpham0412/Covid19_Prediction_Model)](https://github.com/datpham0412/Covid19_Prediction_Model/stargazers)\n[![GitHub forks](https://img.shields.io/github/forks/datpham0412/Covid19_Prediction_Model)](https://github.com/datpham0412/Covid19_Prediction_Model/network/members)\n\n## 📋 Project Description\n\nThe **Covid 19 Prediction Model** is a comprehensive tool designed to predict the spread and impact of Covid-19 using historical data and advanced statistical techniques. The model leverages multiple data sources, including Covid-19 case data and mobility data, to provide accurate forecasts and insights into the pandemic's trends. The project aims to assist policymakers, healthcare professionals, and the general public in understanding and responding to the ongoing Covid-19 crisis.\n\n## 🛠 Technologies Used\n\n\u003cp align=\"left\"\u003e\n    \u003ca href=\"https://www.python.org/downloads\" target=\"_blank\" rel=\"noreferrer\"\u003e\n        \u003cimg src=\"https://raw.githubusercontent.com/devicons/devicon/master/icons/python/python-original.svg\"\n             alt=\"python\" width=\"40\" height=\"40\"/\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://www.w3schools.com/cpp/\" target=\"_blank\" rel=\"noreferrer\"\u003e\n        \u003cimg src=\"https://raw.githubusercontent.com/devicons/devicon/master/icons/cplusplus/cplusplus-original.svg\"\n             alt=\"cplusplus\" width=\"40\" height=\"40\"/\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://www.sqlite.org/download.html\" target=\"_blank\" rel=\"noreferrer\"\u003e\n        \u003cimg src=\"https://upload.wikimedia.org/wikipedia/commons/9/97/Sqlite-square-icon.svg\"\n             alt=\"sqlite\" width=\"40\" height=\"40\"/\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://pandas.pydata.org/\" target=\"_blank\" rel=\"noreferrer\"\u003e\n        \u003cimg src=\"https://miro.medium.com/v2/resize:fit:640/format:webp/1*uyUj__HJekKIkx58kMxlcA.png\"\n             alt=\"pandas\" width=\"40\" height=\"40\"/\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://scikit-learn.org/stable/\" target=\"_blank\" rel=\"noreferrer\"\u003e\n        \u003cimg src=\"https://avatars.githubusercontent.com/u/17349883?s=200\u0026v=4\"\n             alt=\"scikit-learn\" width=\"40\" height=\"40\"/\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://matplotlib.org/\" target=\"_blank\" rel=\"noreferrer\"\u003e\n        \u003cimg src=\"https://cdn.phidgets.com/education/wp-content/uploads/2021/04/Matplotlib_icon.png\"\n             alt=\"matplotlib\" width=\"40\" height=\"40\"/\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://seaborn.pydata.org/\" target=\"_blank\" rel=\"noreferrer\"\u003e\n        \u003cimg src=\"https://cdn.worldvectorlogo.com/logos/seaborn-1.svg\"\n             alt=\"seaborn\" width=\"40\" height=\"40\"/\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://cmake.org/\" target=\"_blank\" rel=\"noreferrer\"\u003e\n        \u003cimg src=\"https://upload.wikimedia.org/wikipedia/commons/1/13/Cmake.svg\"\n             alt=\"cmake\" width=\"40\" height=\"40\"/\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/google/googletest\" target=\"_blank\" rel=\"noreferrer\"\u003e\n        \u003cimg src=\"https://banner2.cleanpng.com/20180423/gkw/kisspng-google-logo-logo-logo-5ade7dc753b015.9317679115245306313428.jpg\"\n             alt=\"google-test\" width=\"40\" height=\"40\"/\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://pypi.org/project/dill/\" target=\"_blank\" rel=\"noreferrer\"\u003e\n        \u003cimg src=\"https://dill.readthedocs.io/en/latest/_static/pathos.png\"\n             alt=\"dill\" width=\"40\" height=\"40\"/\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://jupyter.org/\" target=\"_blank\" rel=\"noreferrer\"\u003e\n        \u003cimg src=\"https://upload.wikimedia.org/wikipedia/commons/3/38/Jupyter_logo.svg\"\n             alt=\"jupyter-notebook\" width=\"40\" height=\"40\"/\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n- **Python**: Core programming language for data processing and model training.\n- **C++**: For efficient data processing and handling large datasets.\n- **SQLite**: Database management for storing and querying data.\n- **Pandas**: Data manipulation and analysis.\n- **Scikit-learn**: Machine learning library for building predictive models.\n- **Matplotlib \u0026 Seaborn**: Data visualization.\n- **CMake**: Cross-platform build system.\n- **Google Test**: Unit testing framework for C++.\n- **Dill**: For model serialization in Python.\n- **Jupyter Notebook**: For interactive data analysis and visualization.\n\n## 📚 Features\n\n- Fetch and preprocess Covid-19 and mobility data from multiple sources.\n- Integrate and clean data, ensuring consistency and accuracy.\n- Create various date-based, lag, and rolling average features to enhance model performance.\n- Train and evaluate machine learning models to predict new Covid-19 cases.\n- Visualize actual vs. predicted cases, residuals, and other key metrics to interpret model performance.\n- Generate detailed reports and visualizations for data exploration and model results.\n- Support for user-defined country data extraction and analysis.\n\n## 🚀 Installation and Running the Project\n\n### Prerequisites\n\n- Ensure you have `git` installed for cloning repositories.\n- Ensure you have CMake installed and added to your system's PATH.\n\n### Steps\n\n1. **Clone the Repository**:\n\n   ```sh\n   git clone https://github.com/datpham0412/Covid19_Prediction_Model.git\n   cd Covid19_Prediction_Model\n   ```\n\n2. **Install CMake**:\n\n   - Download CMake from [here](https://github.com/Kitware/CMake/releases/download/v3.30.0-rc3/cmake-3.30.0-rc3-windows-x86_64.msi)\n   - Add the CMake binary path (e.g., `C:\\Program Files\\CMake\\bin`) to your environment variables.\n\n3. **Clone SQLiteCpp**:\n\n   ```sh\n   cd external\n   git clone https://github.com/SRombauts/SQLiteCpp.git\n   ```\n\n4. **Modify SQLiteCpp CMakeLists.txt**:\n\n   - Open `CMakeLists.txt` in the `external/SQLiteCpp` folder.\n   - Change line 388 from:\n     ```cmake\n     option(SQLITECPP_RUN_CPPLINT \"Run cpplint.py tool for Google C++ StyleGuide.\" ON)\n     ```\n     to:\n     ```cmake\n     option(SQLITECPP_RUN_CPPLINT \"Run cpplint.py tool for Google C++ StyleGuide.\" OFF)\n     ```\n\n5. **Build the Project**:\n\n   ```sh\n   cd ..\n   mkdir build\n   cd build\n   cmake ..\n   cmake --build . --config Release\n   ```\n\n6. **Run the Application**:\n   ```sh\n   cd Release\n   Covid19_Prediction.exe\n   ```\n\n### Python Dependencies\n\nInstall the required Python libraries:\n\n```sh\npip install pandas numpy scikit-learn sqlite3 matplotlib seaborn dill joblib notebook\n```\n\n## Running the scripts\n\n1. **Fetch Data**\n\n```sh\npython scripts/fetch_data.py\n```\n\nThis script fetches COVID-19 and mobility data. Note that this may take up to 10-20 minutes.\n\n2. **Migrate Data**\n\n```sh\npython scripts/migrate_data.py\n```\n\nThis script migrates COVID-19 and mobility data for a specified country from the raw datasets to processed CSV files.\n\n3. **Build the project**\n\n```sh\ncd ..\nmkdir build\ncd build\ncmake ..\ncmake --build . --config Release\ncd Release\nCovid19_Prediction.exe\n```\n\nFollow these steps to configure, build, and run the C++ project.\n\n4. **Process Data**\n\n```sh\npython scripts/data_processing.py\n```\n\nThis script processes the COVID-19 and mobility data for a specific country provided by the user.\n\n5. **Perform EDA**\n\n```sh\npython scripts/eda_visualization.py\n```\n\nThis script performs Exploratory Data Analysis on the processed data.\n\n6. **Feature Engineering**\n\n```sh\npython scripts/feature_engineering.py\n```\n\nThis script performs feature engineering on the processed data.\n\n7. **Split Data**\n\n```sh\npython scripts/split_data.py\n```\n\nThis script splits the data into training and testing sets.\n\n8. **Model Training**\n\n```sh\npython scripts/model_training.py\n```\n\nThis script trains the machine learning model.\n\n9. **Model Evaluation**\n\n```sh\npython scripts/model_evaluation.py\n```\n\nThis script evaluates the performance of the trained model.\n\n10. **Interpret Predictions**\n\n```sh\ncd notebooks\njupyter notebook\n```\n\nOpen interpret_predictions.ipynb in Jupyter Notebook to visualize and interpret the model's predictions.\n\n## 📷 Screenshots\n\n![CorrelationHeatMatrix](https://github.com/datpham0412/Covid19_Prediction_Model/assets/100574389/0f403266-8b3d-4c3c-ab27-28e8f5963ce1)\n![JupyterNotebook2](https://github.com/datpham0412/Covid19_Prediction_Model/assets/100574389/da923b42-92c2-493f-84c4-c6d08ffae03d)\n![NewCases_NewDeathsOverTime](https://github.com/datpham0412/Covid19_Prediction_Model/assets/100574389/a51787f3-ef7f-4366-8849-ec641186a30e)\n![CorrelationScatterPlot](https://github.com/datpham0412/Covid19_Prediction_Model/assets/100574389/3f1631c3-b8dc-4c8e-8732-92c6166ac63c)\n![DistributionNewCases](https://github.com/datpham0412/Covid19_Prediction_Model/assets/100574389/59cddbbc-ca2c-4050-9b85-bd045380cac9)\n![JupyterNotebook1](https://github.com/datpham0412/Covid19_Prediction_Model/assets/100574389/dc8a5a02-ab51-4044-98dc-4f17bd901111)\n![JupyterNotebook2](https://github.com/datpham0412/Covid19_Prediction_Model/assets/100574389/49d71df3-e149-4238-919c-c7791d5420f3)\n![JupyterNotebook3](https://github.com/datpham0412/Covid19_Prediction_Model/assets/100574389/b1db4032-039b-49c5-b804-4a8a780bcca4)\n![JupyterNotebook4](https://github.com/datpham0412/Covid19_Prediction_Model/assets/100574389/787fbf82-9a6e-430c-83b7-e474e8af2eff)\n\n## 📜 License\n\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/datpham0412/Covid19_Prediction_Model/blob/main/LICENSE)) file for details.\n\n## 📞 Contact\n\n## For any inquiries, please contact [tiendat041202@gmail.com](mailto:tiendat041202@gmail.com).\n\nMade with ❤️ by [Dat Pham](https://github.com/datpham0412)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatpham0412%2Fcovid19-prediction-model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatpham0412%2Fcovid19-prediction-model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatpham0412%2Fcovid19-prediction-model/lists"}