https://github.com/cstcloudops/cmos

https://github.com/cstcloudops/cmos

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.1%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: CSTCloudOps
  • Language: Python
  • Default Branch: main
  • Size: 2.73 MB
Statistics
  • Stars: 14
  • Watchers: 0
  • Forks: 1
  • Open Issues: 1
  • Releases: 0
Created about 1 year ago · Last pushed about 1 year ago
Metadata Files
Readme

README.md

CMoS: Rethinking Time Series Prediction Through the Lens of Chunk-wise Spatial Correlations

The repo is the official implementation for the paper: CMoS: Rethinking Time Series Prediction Through the Lens of Chunk-wise Spatial Correlations (ICML'25).

image.png

Introduction

🌟CMoS is a super-lightweight model (1%~20% of DLinear's parameter count) designed for long-term multivariate time series prediction. Two techniques are introduced to achieve better performance and robustness with fewer model parameters: 1. Chunk-wise spatial correlation modeling. Both input series and series to be predicted are split into chunks, and CMoS focuses on modeling the relationships between these input and output chunks via mapping matrices. This technique carries performance and efficiency advantages theoretically and empirically.

  1. Correlation Mixing. We decompose the spatial correlation matrix of each time series into a combination of several foundational matrices, which are shared across all time series. In a system comprising n time series, this strategy enables the model to capture diverse temporal patterns while reducing the parameter complexity from beyond O(n) to O(1). Additionally, the learned foundational matrices offer strong interpretability, aiding in the discovery of key temporal dynamics in the system.

Additionally, we propose Periodictiy Injection technique. By directly editing the initial weights of one foundation correlation matrix, we can inject some priori period knowledge to the model. This makes CMoS more easier to model the periodic spatial correlations, thereby speeding up convergence and enhancing the performance for time series with great periodicity.

Performance and Efficiency

Overall Performance

image.png

Efficiency

Comparison of the prediction performance and parameter count between CMoS and other baselines on Electricity dataset with horizon=192.

Interpretability

We visualized four spatial correlation matrices, which are also referred to as correlation mappings, that are learned from the weather dataset without periodicity injection. The visualization analysis reveals that each spatial correlation mapping captures and emphasizes distinct patterns of temporal dependencies, which can help understand the inherent patterns of the whole system.

Getting Started

Fetching data

We have included the data in our repo. To fetch the data, please install git-lfs first, and then clone this repo. ```shell

Debian-based OS

sudo apt install git-lfs

initialize git lfs

git lfs install

fetch data

git clone https://github.com/CSTCloudOps/CMoS.git

or manually pull data

git lfs pull origin main

```

Enviroment

Conda is recommended to create a virtual environment for this repo: conda create -n CMoS python=3.9 conda activate CMoS conda install pytorch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 pytorch-cuda=11.8 -c pytorch -c nvidia pip install -r requirements.txt

Scripts

You can use the following script to obtain the prediction results (Recommended). For example, for electricity dataset, you can run the following script: ./scripts/electricity.sh

For ultra prediction result, run the grid search script for each dataset (e.g. electricity). This might take a relatively long time. ./scripts/electricity_search_best.sh

The results can be found in model/CMoS/cpkt/{dataset}-{pred_len}/log.txt

Citation

If you find this repo useful, please cite our paper. @inproceedings{si2025CMoS, title={CMoS: Rethinking Time Series Prediction Through the Lens of Chunk-wise Spatial Correlations}, author={Si, Haotian and Pei, Changhua and Li, Jianhui and Pei, Dan and Xie, Gaogang}, booktitle={Forty-second International Conference on Machine Learning}, year={2025} }

Acknowledgement

We appreciate the following GitHub repos a lot for their valuable code and datasets.

https://github.com/thuml/Time-Series-Library

https://github.com/lss-1138/SparseTSF

Owner

  • Name: CSTCloud Lab
  • Login: CSTCloudOps
  • Kind: organization
  • Location: China

GitHub Events

Total
  • Issues event: 1
  • Watch event: 16
  • Issue comment event: 3
  • Member event: 1
  • Push event: 6
  • Fork event: 1
  • Create event: 2
Last Year
  • Issues event: 1
  • Watch event: 16
  • Issue comment event: 3
  • Member event: 1
  • Push event: 6
  • Fork event: 1
  • Create event: 2

Dependencies

requirements.txt pypi
  • Babel ==2.14.0
  • CoLT5-attention ==0.11.0
  • EasyTSAD ==0.1.0
  • Markdown ==3.5.2
  • PyQt5-sip ==12.11.0
  • PyYAML ==6.0.1
  • Pygments ==2.17.2
  • SciencePlots ==2.1.1
  • Werkzeug ==3.1.1
  • absl-py ==2.1.0
  • accelerate ==0.24.1
  • aiohttp ==3.8.5
  • aiosignal ==1.3.1
  • annotated-types ==0.7.0
  • async-timeout ==4.0.3
  • attrs ==23.1.0
  • axial-positional-embedding ==0.2.1
  • brokenaxes ==0.6.2
  • brotlipy ==0.7.0
  • calflops ==0.3.2
  • chardet ==5.2.0
  • click ==8.1.7
  • cmake ==3.31.1
  • colorama ==0.4.6
  • cupy-cuda11x ==13.2.0
  • datasets ==3.0.1
  • deepspeed ==0.16.0
  • dill ==0.3.8
  • dtaidistance ==2.3.12
  • einops ==0.8.0
  • fastdtw ==0.3.4
  • fastrlock ==0.8.2
  • fonttools ==4.25.0
  • frozenlist ==1.4.0
  • fsspec ==2023.9.0
  • ghp-import ==2.1.0
  • griffe ==0.40.1
  • grpcio ==1.67.1
  • h5py ==3.10.0
  • hjson ==3.1.0
  • huggingface-hub ==0.24.2
  • importlib-metadata ==7.0.1
  • lightning-utilities ==0.9.0
  • lit ==18.1.8
  • llvmlite ==0.42.0
  • local-attention ==1.9.14
  • markdown-callouts ==0.4.0
  • matplotlib ==3.8.0
  • mergedeep ==1.3.4
  • mkdocs ==1.5.3
  • mkdocs-autorefs ==0.5.0
  • mkdocs-material ==9.5.11
  • mkdocs-material-extensions ==1.3.1
  • mkdocstrings ==0.24.0
  • mkdocstrings-crystal ==0.3.7
  • mkdocstrings-python ==1.8.0
  • mkl-service ==2.4.0
  • msgpack ==1.1.0
  • multidict ==6.0.4
  • multiprocess ==0.70.16
  • munkres ==1.1.4
  • ninja ==1.11.1.2
  • numpy ==1.26.1
  • nvidia-ml-py ==12.560.30
  • onnx ==1.17.0
  • paginate ==0.5.6
  • pandas ==2.1.2
  • pathspec ==0.12.1
  • patsy ==0.5.3
  • platformdirs ==4.2.0
  • plotly ==5.23.0
  • ply ==3.11
  • product_key_memory ==0.2.11
  • protobuf ==5.28.3
  • psutil ==5.9.6
  • py-cpuinfo ==9.0.0
  • pyarrow ==17.0.0
  • pydantic ==2.10.2
  • pydantic_core ==2.27.1
  • pymdown-extensions ==10.7
  • pytorch-lightning ==2.0.1
  • pytorch-ranger ==0.1.1
  • pyyaml_env_tag ==0.1
  • reformer-pytorch ==1.4.4
  • regex ==2023.10.3
  • requests ==2.32.3
  • safetensors ==0.4.3
  • scikit-learn ==1.3.2
  • seaborn ==0.13.0
  • tenacity ==9.0.0
  • tensorboard ==2.18.0
  • tensorboard-data-server ==0.7.2
  • tensorboardX ==2.6.2.2
  • threadpoolctl ==3.5.0
  • tokenizers ==0.19.1
  • torch ==2.0.1
  • torch-optimizer ==0.3.0
  • torch-tb-profiler ==0.4.3
  • torchaudio ==2.0.2
  • torchinfo ==1.8.0
  • torchmetrics ==1.1.1
  • torchvision ==0.15.2
  • tqdm ==4.66.5
  • transformers ==4.40.1
  • triton ==2.0.0
  • typing_extensions ==4.12.2
  • watchdog ==4.0.0
  • xxhash ==3.5.0
  • yarl ==1.9.2