Home

Awesome

[CIKM23] MemDA: Forecasting Urban Time Series with Memory-based Drift Adaptation

This repository contains the official code and datasets presented in our paper, "MemDA: Forecasting Urban Time Series with Memory-based Drift Adaptation," accepted by the 32nd ACM International Conference on Information and Knowledge Management (CIKM '23).

Read the CIKM23 proceeding paper here.

arXiv is here. Arxiv link

Dataset Description

We collected data from four cities covering different data sources and concept drift types. The PeMS and Beijing datasets are collected from the traffic speeds of major roads in California and Beijing. The Electricity dataset contains the electricity consumption. And the COVID-CHI dataset is the demand for shared bicycles collected from Chicago.

Data Information:

DatasetTime PeriodTrain/Test SplitNodeTemporal
PeMS2020/01/01~2020/07/312020/03/013255 minutes
Beijing2022/05/12~2022/07/252022/06/0631265 minutes
Electricity2012/01/01~2012/06/302012/04/013701 hour
COVID-CHI2019/07/01~2020/12/312020/03/011122 hour

Data Presentation:

Macro presentation of the Beijing dataset: Panel

Basic data analysis with jupyter notebook:

data_describe.ipynb

File Format:

Usage

To use the model for forecasting, follow the command below:

python pred_MemDA.py

The pred_MemDA_beijing.py is singled out because the Beijing dataset is too large to load into the GPU.

Note that small datasets are known to be sensitive to the initialization of Replay Memory, so we recommend using the plain version of MemDA pred_MemDA_Plain.py on small datasets for more stable results.

Custom Encoder

MemDA features integration with diverse existing time series forecasting models. We primarily utilized GraphWaveNet in our experiments. However, you can easily switch to a more powerful encoder to achieve superior results.

To integrate your custom encoder:

  1. Place your encoder file in the directory: ./code/encoder/.
  2. In the MemDA.py file, update the memda_net class to call your custom encoder.

Input/Output Specifications:

Parameters & Configuration

You can implement different configurations by modifying the parameters in the ./setting/Param.py file. Here's a detailed description of the parameters:

Dependencies

The program is executed under python 3.8 based on the requirements.txt library.

Repository Structure

├── code
│   ├── encoder
│   │   └── Encoder_GWN.py
│   ├── setting
│   │   ├── Dataset_Setting.py
│   │   └── Param.py
│   ├── utils
│   │   ├── Metrics.py
│   │   └── Utils.py
│   ├── MemDA.py
│   ├── pred_MemDA.py
│   ├── pred_MemDA_beijing.py
│   └── pred_MemDA_Plain.py
└── data
    ├── Beijing
    ├── COVID-CHI
    ├── Electricity
    └── PeMS20

Citation

If you find our work useful, please cite the following:

@inproceedings{cai2023memda,
  title={MemDA: Forecasting Urban Time Series with Memory-based Drift Adaptation},
  author={Cai, Zekun and Jiang, Renhe and Yang, Xinyu and Wang, Zhaonan and Guo, Diansheng and Kobayashi, Hill Hiroki and Song, Xuan and Shibasaki, Ryosuke},
  booktitle={Proceedings of the 32nd ACM International Conference on Information and Knowledge Management},
  pages={193--202},
  year={2023}
}

License

This project is licensed under the MIT License - see the LICENSE file for details.