Giter Club home page Giter Club logo

stgnn-for-covid-in-korea's Introduction

STGNN for COVID-19 prediction in Korea

Introduction

This repository contains implementation of Spatio-Temporal Graph Neural Network and other approaches for dealing with COVID-19 case forecasting in South Korea dataset.

Requirements

  • Python 3
  • Tensorflow 2.*
  • Tensorflow GPU (recommended)
  • Pytorch

Installation

  • Clone the repository and install the package
git clone https://github.com/KienMN/STGNN-for-Covid-in-Korea.git
cd STGNN-for-Covid-in-Korea
pip install -e .
  • Install package using pip
pip install git+https://github.com/KienMN/STGNN-for-Covid-in-Korea.git

Main components

There are some components/modules in our code. Please check our documentation in each file for more details.

Datasets

This module handles:

  • Load dataset from CSV file.
  • Difference data.
  • Split data according to date.
  • Rescale data.
  • Turn time series data into supervised sequence data for machine learning models.

Models

This module contains different model classes.

  • LSTM.
  • Seq2Seq.
  • Spatio-Temporal Graph neural network (STGNN).

Trainer

Trainer contains every information (such as dataset, optimizer, loss function, etc) for training each type of models mentioned above.

Callbacks

This module consists of callbacks which can be executed before/after some steps of training or testing model.

Utils

Utility functions that can be used any where in the code.

Experiments

All running files are stored in tests folder. Configuration of experiments can be found in tests/configs. Make results folder to store output of experiments.

mkdir tests/results

The script to run experiments is

python tests/test_{model_name}.py

The process in a test file is as follow, check each file for more details.

  • Import necessary libraries.
  • Setup configs and parameters.
  • Load and process data.
  • Define functions to handle post-prediction to make predictions back to original scale.
  • Create model, select loss function and optimizer.
  • Create a trainer containing necessary information.
  • Train the model via the trainer.
  • Make prediction and compute metrics.

After finishing, predictions and metric scores will be stored as CSV file in tests/results folder.

References

  1. COVID-19 in Korea datasets: https://kosis.kr/covid_eng/covid_index.do; https://www.kaggle.com/kimjihoo/coronavirusdataset.
  2. STGCN in traffic: https://github.com/FelixOpolka/STGCN-PyTorch.
  3. Seq2Seq in Neural machine translation: https://www.tensorflow.org/tutorials/text/nmt_with_attention.

stgnn-for-covid-in-korea's People

Contributors

kienmn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.