OCE-TS

November 17, 2025 ยท View on GitHub

Beyond MSE: Ordinal Cross-Entropy for Probabilistic Time Series Forecasting

OCE-TS is a novel probabilistic time series forecasting framework that replaces traditional Mean Squared Error (MSE) regression with an Ordinal Cross-Entropy (OCE) classification paradigm. The method provides more stable optimization, improved robustness, and inherent uncertainty estimation across multiple benchmark datasets.


๐Ÿš€ Features

  • Probabilistic forecasting with uncertainty estimation
  • Ordinal Cross-Entropy (OCE) loss to preserve temporal ordering
  • Robust to noise and outliers
  • Supports multiple datasets (ETTh, ETTm, Exchange, Weather, ILI, etc.)
  • Lightweight backbone based on DLinear

๐Ÿ“ฆ Environment & Requirements

This project was implemented in the following environment:

  • Python 3.8.20
  • PyTorch 2.0.0 (CUDA 11.8)
  • GPU: NVIDIA RTX 4060
  • CPU: Intel i7-14700F
  • RAM: 16 GB

Install dependencies:

pip install -r requirements.txt

๐Ÿƒ Usage

Run (Train + Test)

Running the script below will automatically perform both training and testing:

python run_longExp.py

MyLinear/
โ”‚โ”€โ”€ Da/ # Data augmentation or auxiliary data
โ”‚โ”€โ”€ data_provider/ # Data loading and preprocessing
โ”‚โ”€โ”€ dataset/ # Dataset files and utilities
โ”‚โ”€โ”€ exp/ # Experiment manager (training/testing)
โ”‚โ”€โ”€ layers/ # Model layers
โ”‚โ”€โ”€ logs/ # Training logs
โ”‚โ”€โ”€ loss/ # Loss functions (OCE, CE, Gaussian, etc.)
โ”‚โ”€โ”€ models/ # Forecasting models (DLinear, OCE-TS modules)
โ”‚โ”€โ”€ results/ # Result figures, MAE/MSE plots, tables
โ”‚โ”€โ”€ scripts/ # Helper scripts / run scripts
โ”‚โ”€โ”€ test_results/ # Saved test outputs
โ”‚โ”€โ”€ utils/ # Utility functions (Gaussian, noise, lookback, etc.)
โ”‚
โ”‚โ”€โ”€ distribution.py
โ”‚โ”€โ”€ Gaussian.py
โ”‚โ”€โ”€ lookback.py
โ”‚โ”€โ”€ loss_compare.py
โ”‚โ”€โ”€ ModelComparisonPlot.py
โ”‚โ”€โ”€ noise.py
โ”‚โ”€โ”€ OCE vs CE.py
โ”‚โ”€โ”€ Parameter.py
โ”‚โ”€โ”€ Probability Distribution Comparison.py
โ”‚โ”€โ”€ run_longExp.py # Main entry script (train+test)
โ”‚โ”€โ”€ sh.py
โ”‚โ”€โ”€ result.txt
โ”‚โ”€โ”€ *.png # Visualization images


---

## ๐Ÿ“Š Results

Our method (OCE-TS) consistently outperforms strong baselines such as  
Autoformer, DLinear, iTransformer, TimeXer, and TimeBridge across multiple datasets.

For detailed experimental results, tables, and comparisons,  
**please refer to the paper**.


## ๐Ÿ“š Citation

If you use this repository, please cite:

```bibtex
@misc{wang2025mseordinalcrossentropyprobabilistic,
	title={Beyond MSE: Ordinal Cross-Entropy for Probabilistic Time Series Forecasting}, 
	author={Jieting Wang and Huimei Shi and Feijiang Li and Xiaolei Shang},
	year={2025},
	eprint={2511.10200},
	archivePrefix={arXiv},
	primaryClass={cs.LG},
	url={https://arxiv.org/abs/2511.10200}, 
}

๐Ÿ“„ License

MIT License