MCPcopy Index your code
hub / github.com/Dingdong-Inc/frn-50k-baseline

github.com/Dingdong-Inc/frn-50k-baseline @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
1,045 symbols 3,326 edges 225 files 378 documented · 36%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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:
- TimesNet: TimesNet: Temporal 2D-Variation Modeling for General Time Series Analysis
- ImputeFormer: ImputeFormer: Low Rankness-Induced Transformers for Generalizable Spatiotemporal Imputation
- SAITS: SAITS: Self-attention-based imputation for time series
- iTransformer: iTransformer: Inverted Transformers Are Effective for Time Series Forecasting
- GPVAE: GP-VAE: Deep Probabilistic Time Series Imputation
- CSDI: Conditional Sequential Deep Imputation for Irregularly-Sampled Time Series
- DLinear: Are Transformers Effective for Time Series Forecasting?

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. - Paper link: Temporal Fusion Transformers for Interpretable Multi-horizon Time Series Forecasting - Reference Code link: https://github.com/sktime/pytorch-forecasting

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. - Paper link: Are Transformers Effective for Time Series Forecasting? - Reference Code link: https://github.com/cure-lab/LTSF-Linear

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},
}

Core symbols most depended-on inside this repo

size
called by 64
demand_forecasting/TFT/models/base_model.py
_send_data_to_given_device
called by 34
latent_demand_recovery/pypots/base.py
load_state_dict
called by 22
latent_demand_recovery/pypots/optim/base.py
_auto_save_model_if_necessary
called by 21
latent_demand_recovery/pypots/base.py
transform
called by 19
demand_forecasting/DLinear/utils/tools.py
init_optimizer
called by 19
latent_demand_recovery/pypots/optim/sgd.py
_send_model_to_given_device
called by 18
latent_demand_recovery/pypots/base.py
_print_model_size
called by 18
latent_demand_recovery/pypots/base.py

Shape

Method 727
Class 203
Function 115

Languages

Python100%

Modules by API surface

demand_forecasting/TFT/models/base_model.py56 symbols
demand_forecasting/TFT/data/timeseries.py43 symbols
latent_demand_recovery/pypots/nn/modules/etsformer/layers.py38 symbols
latent_demand_recovery/pypots/nn/modules/fedformer/layers.py36 symbols
latent_demand_recovery/pypots/nn/modules/autoformer/layers.py24 symbols
latent_demand_recovery/pypots/nn/modules/transformer/embedding.py18 symbols
latent_demand_recovery/pypots/nn/modules/informer/layers.py18 symbols
latent_demand_recovery/pypots/base.py17 symbols
demand_forecasting/TFT/models/tft/model.py16 symbols
latent_demand_recovery/pypots/nn/modules/patchtst/layers.py15 symbols
latent_demand_recovery/pypots/nn/modules/gpvae/layers.py15 symbols
latent_demand_recovery/pypots/nn/modules/csdi/layers.py14 symbols

For agents

$ claude mcp add frn-50k-baseline \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page