MaGNet: A Mamba Dual-Hypergraph Network for Stock Prediction via Temporal-Causal and Global Relational Learning
The repo is the official implementation for the paper: MaGNet: A Mamba Dual-Hypergraph Network for Stock Prediction via Temporal-Causal and Global Relational Learning .
MaGNet is a Mamba dual-hypergraph network that integrates advanced temporal modeling with dual hypergraph relational learning to capture both causal and global market dependencies.
All datasets and model weights are available on Google Drive: 👉 Download Link
Included datasets:
- DJIA
- NASDAQ 100
- CSI 300
Download or clone this code repository to your local machine.
Download one of the datasets from the Google Drive link above:
- DJIA:
djia_alpha158_alpha360.pt - NASDAQ100:
nas100_alpha158_alpha360.pt - CSI300:
csi300_alpha158_alpha360.pt
Place the downloaded file in the same directory as the codebase. Run the following command to train the model and make predictions (including training, validation, and test sets):
python train.pyDownload the dataset and its corresponding model weight from the same link:
- DJIA:
djia_alpha158_alpha360.pt&djia_weight.pt - NASDAQ100:
nas100_alpha158_alpha360.pt&nas100_weight.pt - CSI300:
csi300_alpha158_alpha360.pt&csi300_weight.pt
Place the downloaded files in the same directory as the codebase. Run the following command to perform backtesting and results:
python backtest.pyBelow are the backtesting performance charts of MaGNet on all datasets:
We would appreciate it if you could cite the following paper if you found the repository useful for your work:
@misc{tan2025magnetmambadualhypergraphnetwork,
title={MaGNet: A Mamba Dual-Hypergraph Network for Stock Prediction via Temporal-Causal and Global Relational Learning},
author={Peilin Tan and Chuanqi Shi and Dian Tu and Liang Xie},
year={2025},
eprint={2511.00085},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2511.00085},
}





