Skip to content

KillaWan/truncat_norm

Repository files navigation

frn-50k-baseline

Overview

The Repo is a baseline for Dataset FreshRetailNet-50K, which provides the complete pipeline used to train and evaluate.

You can discover the methodology and technical details behind FreshRetailNet-50K in Technical Report.

Running Experiments

Environment Requirements

It is recommended to create a new environment using conda.

conda create --name py3.8_frn python=3.8
conda activate py3.8_frn
pip install -r ./requirements.txt

Latent Demand Recovery

Latent Demand Recovery implements multiple baselines, including TimesNet, ImputeFormer, SAITS, iTransformer, GPVAE, CSDI, and DLinear. The code is referenced from PyPOTS. Links to the corresponding papers for each model are provided below:

cd latent_demand_recovery/exp
# Conduct MNAR evaluation on different models with various artificial missing rates, such as model=TimesNet and missing_rate=0.3
python app.py --model TimesNet --missing_rate 0.3
# Perform demand recovery on raw data, reconstructing demand from censored sales
python app.py --model TimesNet

Demand Forcasting

SSA

The similar scenario average (SSA) is a common method (statistics-based) for demand forecasting.

To train and evaluate easily on censored/recovered sales, run:

cd demand_forecasting/SSA

# Perform demand forecasting on censored sales
python ssa_forecasting.py

# Perform demand forecasting on recovered demand, which requires running Latent Demand Recovery first.
# For example, python app.py --model TimesNet
python ssa_forecasting.py --demand

TFT

Temporal Fusion Transformer (TFT) is a novel attention-based architecture which combines high-performance multi-horizon forecasting with interpretable insights into temporal dynamics.

To train and evaluate easily on censored/recovered sales, run:

cd demand_forecasting/TFT

# Perform demand forecasting on censored sales
python3 trainTFT.py    # train models
python3 predictTFT.py  # evaluate after finishing trainning

# Perform demand forecasting on recovered demand, which requires running Latent Demand Recovery first.
# For example, python app.py --model TimesNet
python3 trainTFT.py --demand     # train models
python3 predictTFT.py --demand   # evaluate after finishing trainning

DLinear

DLinear is a set of embarrassingly simple one-layer linear models named LTSF-Linear for the long-term time series forecasting (LTSF) task.

To train and evaluate easily on censored/recovered sales, run:

cd demand_forecasting/DLinear

# Perform demand forecasting on censored sales
sh train_predict.sh

# Perform demand forecasting on recovered demand, which requires running Latent Demand Recovery first.
# For example, python app.py --model TimesNet
sh train_predict_on_recovered.sh

Citation

If you find the data useful, please cite:

@article{2025freshretailnet-50k,
      title={FreshRetailNet-50K: A Stockout-Annotated Censored Demand Dataset for Latent Demand Recovery and Forecasting in Fresh Retail},
      author={Yangyang Wang, Jiawei Gu, Li Long, Xin Li, Li Shen, Zhouyu Fu, Xiangjun Zhou, Xu Jiang},
      year={2025},
      eprint={2505.16319},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2505.16319},
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors