Skip to content

hlhang9527/LMHR

Repository files navigation

LMHR: Leveraging Long-Term Multivariate History Representation for Time Series Forecasting

This is the official repository for the paper [Leveraging Long-Term Multivariate History Representation for Time Series Forecasting (LMHR)].
It contains:

  • 📊 Raw datasets
  • 🧰 Supporting libraries and source code
  • 📉 Baseline models
  • 🚀 Our proposed LMHR model implementation

🚀 Getting Started

1. Python Environment

  • Python ≥ 3.7 (Recommended: ≥ 3.9)
  • Use Miniconda or Anaconda to manage your virtual environment.

Install PyTorch

pip install torch==1.10.0+cu111 torchvision==0.11.0+cu111 torchaudio==0.10.0 \
    -f https://download.pytorch.org/whl/torch_stable.html

Install Other Dependencies

pip install -r requirements_new.txt

2. Preprocess Data

The raw datasets used in this paper can be accessed from the raw_data directory provided in the repository.

Option A: Preprocess a Single Dataset

cd /path/to/your/project
python scripts/data_preparation/${DATASET_NAME}/generate_training_data.py

Replace ${DATASET_NAME} with the dataset's name:
PEMS-BAY, PEMS04, etc., or any other supported datasets.

Processed data will be saved to:

datasets/${DATASET_NAME}/

Option B: Preprocess All Datasets

cd /path/to/your/project
bash scripts/data_preparation/all.sh

3. Train Models

Train LMHR or a Baseline Model (e.g. STEP)

python run.py -c STEP_PEMS04.py --gpus '0'
python run.py -c LMHR_PEMS04.py --gpus '0'

4. Test Models

python test.py -c STEP_PEMS04.py \
    --task test \
    --ckpt /path/to/your/saved/model.pt \
    --gpus '0'

5. Run Other Baseline Models

For other baseline models integrated into the framework:

python run.py -c /examples/path/to/model_config.py --gpus '0'

For baselines not integrated into this repo, please refer to:
👉 https://github.com/GestaltCogTeam/BasicTS


📁 Project Structure Overview

.
├── datasets/
├── scripts/
│   └── data_preparation/
├── models/
├── run.py
├── test.py
└── requirements_new.txt

📌 Citation & Acknowledgment

Coming soon


For questions or contributions, feel free to open an issue or submit a PR!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors