# SCINet
[![Arxiv link](https://img.shields.io/badge/arXiv-Time%20Series%20is%20a%20Special%20Sequence%3A%20Forecasting%20with%20Sample%20Convolution%20and%20Interaction-%23B31B1B)](https://arxiv.org/pdf/2106.09305.pdf)
![state-of-the-art](https://img.shields.io/badge/-STATE--OF--THE--ART-blue?logo=Accenture&labelColor=lightgrey)![pytorch](https://img.shields.io/badge/-PyTorch-%23EE4C2C?logo=PyTorch&labelColor=lightgrey)
This is the original pytorch implementation for the following paper: [SCINet: Time Series Modeling and Forecasting with Sample Convolution and Interaction](https://arxiv.org/pdf/2106.09305.pdf). Alse see the [Open Review verision](https://openreview.net/pdf?id=AyajSjTAzmg).
If you find this repository useful for your research work, please consider citing it as follows:
```
@article{liu2022SCINet,
title={SCINet: Time Series Modeling and Forecasting with Sample Convolution and Interaction},
author={Liu, Minhao and Zeng, Ailing and Chen, Muxi and Xu, Zhijian and Lai, Qiuxia and Ma, Lingna and Xu, Qiang},
journal={Thirty-sixth Conference on Neural Information Processing Systems (NeurIPS), 2022},
year={2022}
}
```
## Updates
- [2022-09-15] SCINet has been accepted to NeurIPS 2022!
- [2021-11-10] Added Reversible Instance Normalization RevIN[1] support!
- [2021-09-17] SCINet v1.0 is released
## Features
- [x] Support **11** popular time-series forecasting datasets, namely Electricity Transformer Temperature (ETTh1, ETTh2 and ETTm1) , Traffic, Solar-Energy, Electricity and Exchange Rate and PeMS (PEMS03, PEMS04, PEMS07 and PEMS08), ranging from power, energy, finance and traffic domains.
[comment]: <> (![traffic](https://img.shields.io/badge/ð
-Traffic-yellow))
[comment]: <> (![electric](https://img.shields.io/badge/%F0%9F%92%A1-Electricity-yellow))
[comment]: <> (![Solar Energy](https://img.shields.io/badge/%F0%9F%94%86-Solar%20Energy-yellow))
[comment]: <> (![finance](https://img.shields.io/badge/ðµ-Finance-yellow))
- [x] Provide all training logs.
- [x] Support RevIN to handle datasets with a large train-test sample distribution gap. To activate, simply add ```--RIN True``` to the command line. [**Read more**](./docs/RevIN.md)
## To-do items
- Integrate GNN-based spatial models into SCINet for better performance and higher efficiency on spatial-temporal time series. Our preliminary results show that this feature could result in considerable gains on the prediction accuracy of some datasets (e.g., PEMSxx).
- Generate probalistic forecasting results.
Stay tuned!
## Used Datasets
We conduct the experiments on **11** popular time-series datasets, namely **Electricity Transformer Temperature (ETTh1, ETTh2 and ETTm1) , PeMS (PEMS03, PEMS04, PEMS07 and PEMS08) and Traffic, Solar-Energy, Electricity and Exchange Rate**, ranging from **power, energy, finance and traffic domains**.
### Overall information of the 11 datasets
| Datasets | Variants | Timesteps | Granularity | Start time | Task Type |
| ------------- | -------- | --------- | ----------- | ---------- | ----------- |
| ETTh1 | 7 | 17,420 | 1hour | 7/1/2016 | Multi-step |
| ETTh2 | 7 | 17,420 | 1hour | 7/1/2016 | Multi-step |
| ETTm1 | 7 | 69,680 | 15min | 7/1/2016 | Multi-step |
| PEMS03 | 358 | 26,209 | 5min | 5/1/2012 | Multi-step |
| PEMS04 | 307 | 16,992 | 5min | 7/1/2017 | Multi-step |
| PEMS07 | 883 | 28,224 | 5min | 5/1/2017 | Multi-step |
| PEMS08 | 170 | 17,856 | 5min | 3/1/2012 | Multi-step |
| Traffic | 862 | 17,544 | 1hour | 1/1/2015 | Single-step |
| Solar-Energy | 137 | 52,560 | 1hour | 1/1/2006 | Single-step |
| Electricity | 321 | 26,304 | 1hour | 1/1/2012 | Single-step |
| Exchange-Rate | 8 | 7,588 | 1hour | 1/1/1990 | Single-step |
## Get started
### Requirements
Install the required package first:
```
cd SCINet
conda create -n scinet python=3.8
conda activate scinet
pip install -r requirements.txt
```
### Dataset preparation
All datasets can be downloaded [here](https://drive.google.com/drive/folders/1Gv1MXjLo5bLGep4bsqDyaNMI2oQC9GH2?usp=sharing). To prepare all dataset at one time, you can just run:
```
source prepare_data.sh
```
[![ett](https://img.shields.io/badge/Download-ETT_Dataset-%234285F4?logo=GoogleDrive&labelColor=lightgrey)](https://drive.google.com/drive/folders/1NU85EuopJNkptFroPtQVXMZE70zaBznZ)
[![pems](https://img.shields.io/badge/Download-PeMS_Dataset-%234285F4?logo=GoogleDrive&labelColor=lightgrey)](https://drive.google.com/drive/folders/17fwxGyQ3Qb0TLOalI-Y9wfgTPuXSYgiI)
[![financial](https://img.shields.io/badge/Download-financial_Dataset-%234285F4?logo=GoogleDrive&labelColor=lightgrey)](https://drive.google.com/drive/folders/12ffxwxVAGM_MQiYpIk9aBLQrb2xQupT-)
The data directory structure is shown as follows.
```
./
âââ datasets/
âââ ETT-data
â âââ ETTh1.csv
â âââ ETTh2.csv
â âââ ETTm1.csv
âââ financial
â âââ electricity.txt
â âââ exchange_rate.txt
â âââ solar_AL.txt
â âââ traffic.txt
âââ PEMS
âââ PEMS03.npz
âââ PEMS04.npz
âââ PEMS07.npz
âââ PEMS08.npz
```
### Run training code
We follow the same settings of [StemGNN](https://github.com/microsoft/StemGNN) for PEMS 03, 04, 07, 08 datasets, [MTGNN](https://github.com/nnzhan/MTGNN) for Solar, electricity, traffic, financial datasets, [Informer](https://github.com/zhouhaoyi/Informer2020) for ETTH1, ETTH2, ETTM1 datasets. The detailed training commands are given as follows.
#### For PEMS dataset (All datasets follow Input 12, Output 12):
pems03
```
python run_pems.py --dataset PEMS03 --hidden-size 0.0625 --dropout 0.25 --model_name pems03_h0.0625_dp0.25 --num_decoder_layer 2
```
pems04
```
python run_pems.py --dataset PEMS04 --hidden-size 0.0625 --dropout 0 --model_name pems04_h0.0625_dp0
```
pems07
```
python run_pems.py --dataset PEMS07 --hidden-size 0.03125 --dropout 0.25 --model_name pems07_h0.03125_dp0.25
```
pems08
```
python run_pems.py --dataset PEMS08 --hidden-size 1 --dropout 0.5 --model_name pems08_h1_dp0.5
```
##### PEMS Parameter highlights
| Parameter Name | Description | Parameter in paper | Default |
| -------------- | ----------------------- | ------------------ | ------- |
| dataset | Name of dataset | N/A | PEMS08 |
| horizon | Horizon | Horizon | 12 |
| window_size | Look-back window | Look-back window | 12 |
| hidden-size | hidden expansion | h | 1 |
| levels | SCINet block levels | L | 2 |
| stacks | The number of SCINet block| K | 1 |
#### For Solar dataset:
predict 3
```
python run_financial.py --dataset_name solar_AL --window_size 160 --horizon 3 --hidden-size 1 --lastWeight 0.5 --stacks 2 --levels 4 --lradj 2 --lr 1e-4 --dropout 0.25 --batch_size 256 --model_name so_I160_o3_lr1e-4_bs256_dp0.25_h1_s2l4_w0.5
```
predict 6
```
python run_financial.py --dataset_name solar_AL --window_size 160 --horizon 6 --hidden-size 0.5 --lastWeight 0.5 --stacks 2 --levels 4 --lradj 2 --lr 1e-4 --dropout 0.25 --batch_size 256 --model_name so_I160_o6_lr1e-4_bs256_dp0.25_h0.5_s2l4_w0.5
```
predict 12
```
python run_financial.py --dataset_name solar_AL --window_size 160 --horizon 12 --hidden-size 2 --lastWeight 0.5 --stacks 2 --levels 4 --lradj 2 --lr 1e-4 --dropout 0.25 --batch_size 1024 --model_name so_I160_o12_lr1e-4_bs1024_dp0.25_h2_s2l4_w0.5
```
predict 24
```
python run_financial.py --dataset_name solar_AL --window_size 160 --horizon
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
基于SCINet网络的时间序列建模和预测(Pytorch完整源码和数据) 基于SCINet网络的时间序列建模和预测(Pytorch完整源码和数据) 基于SCINet网络的时间序列建模和预测(Pytorch完整源码和数据) 基于SCINet网络的时间序列建模和预测(Pytorch完整源码和数据) SCINet 时间序列 Pytorch完整源码和数据
资源推荐
资源详情
资源评论
收起资源包目录
基于SCINet网络的时间序列建模和预测.zip (31个子文件)
SCINet-main
models
SCINet.py 17KB
__init__.py 0B
SCINet_decompose.py 11KB
metrics
Finantial_metics.py 141B
ETTh_metrics.py 1KB
data_process
financial_dataloader.py 4KB
__init__.py 0B
etth_data_loader.py 13KB
forecast_dataloader.py 4KB
docs
RevIN.md 813B
prepare_data.sh 983B
run_pems.py 4KB
run_financial.py 5KB
LICENSE 11KB
experiments
exp_pems.py 21KB
exp_financial.py 19KB
__init__.py 0B
exp_ETTh.py 18KB
exp_basic.py 869B
requirements.txt 59B
.gitignore 191B
Appendix
Appendix.pdf 293KB
plot.py 2KB
README.md 25KB
run_ETTh.py 9KB
utils
histogram.ipynb 30KB
tools.py 4KB
math_utils.py 3KB
recursive_demo.py 2KB
__init__.py 0B
timefeatures.py 4KB
共 31 条
- 1
资源评论
前程算法屋
- 粉丝: 5759
- 资源: 835
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功