Coder Social home page Coder Social logo

covid19_predict's Introduction

covid19_predict

A simple Python predictor for covid19 data. Note: this code uses simple ML and feature extraction techniques and it does not take into consideration any other parameters (weather-related, socio-economic etc). It's role is for 100% educational purposes for demonstrating how ML can be used to predict time sequence values.

Methodology

  • Total number of cases (per day) are first normalized by country population.
  • Training data is created by extracting the following features for each data point (day) of the dataset: 1st derivative, 2nd derivative and deltas from days -2 and -3. Same for number of deaths. As a "ground truth" (target) value we use the true relative case increase (new cases) in the next day.
  • An SVM linear regressor is trained using the data of the previous tep.
  • SVM is used to predict (normalized) new cases for tomorrow and the next day (denormalization also needs to applied so that the final outcome is in number of new cases)
  • Predictions are shown in the terminal. The two plots show (a) total cases and deaths (and normalized) (b) new cases and predicted values (simulated results using cross validation)

Install dependencies

pip3 install -r requirements.txt

Get data

We get the data from Our World in Data. In particular, the total deaths and total cases csv files are downloaded as follow:

wget https://covid.ourworldindata.org/data/total_deaths.csv

wget https://covid.ourworldindata.org/data/total_cases.csv

Also, the populations.csv file contains the 2013 populations for all countries (a bit outdated, but this is just used for normalization of the COVID19 data). Of course more recent data are more by welcome by contributors :-)

Run predictions for a list of selected countries of interest

python3 main.py -c greece italy germany "united kingdom" "united states"

covid19_predict's People

Contributors

tyiannak avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.