Official implementation of Predictive and Prescriptive Performance of Bike-Sharing Demand Forecasts for Inventory Management
To install all required dependencies, run
pip install -r requirements.txt
src/algos/vprnn.py
: PyTorch implementation of VP-RNN and MOVP-RNN modules (Section 3.2).src/algos/inventory_decision_hourly.py
: implementation of queuing model for inventory management with 60-min interval (Section 3.1).src/algos/inventory_decision_quarterly.py
: implementation of queuing model for inventory management with finer aggregation levels: 15-, 30-min intervals.src/misc/
: helper functions.data/
: csv files for NYC experiments.saved_files/
: directory for saving results, logging, etc.run_vprnn.py
: script for running VP-RNN on NYC data.run_movprnn.py
: script for running MOVP-RNN on NYC data.
To run the VP-RNN pipeline, run_vprnn.py
accepts the following arguments:
model arguments:
--epochs number of epochs to train (default: 50k)
--no-cuda disables CUDA training (default: False, i.e. run on CPU)
--seed random seed (default: 1)
--patience how many epochs without improvement to stop training
--no-train disables training process (default: False, i.e. train)
--no-predict disables prediction process (default: False, i.e. generate predictions)
--no-decision disables decision model (default: False, i.e. run queueing model)
--benchmark enables benchmark decision (default: False, i.e. disables benchmark decision calculation)
data arguments:
--stations list of station IDs on which to run pipeline
--interval defines temporal aggregation (defaul: 60min)
- To train, compute demand predictions, and inventory decisions with an VPRNN model (using the default parameters) on e.g. station 426 and 229, run the following:
python run_vprnn.py --stations 426 229
During execution, this will store the following:
- Model parameter after training in
saved_files/{15,30,60}min/trained_models/rnn/
- Prediction and Optimization performance in
saved_files/{15,30,60}min/results/
- Predicted demand vectors in
saved_files/{15,30,60}min/predicted_demand/
- Qualitative visualization of demand predictions in
saved_files/{15,30,60}min/images/
- Inventory decision in
saved_files/{15,30,60}min/inventory_decisions/
- To only generate inventory decisions with different pre-trained demand predictions for comparison, on e.g. station 426 and 229, run the following:
python run_vprnn.py --stations 426 229 --no-train 1 --no-predict 1 --benchmark
Note that the inventory decision model needs to read pre-trained demand predictions stored in saved_files/{15,30,60}min/predicted_demand/
. Make sure there are predicted demand vectors stored in this directory.
During execution, this will store the following:
- Inventory decision in
saved_files/{15,30,60}min/inventory_decisions/
- Optimization performance in
saved_files/{15,30,60}min/results/optimization
This work was conducted as a joint effort with Yihua Wang*, Dennis Prak*, Filipe Rodrigues', Stefan Minner* and Francisco C. Pereira', at Technical University of Denmark' and Technical University of Munich*.
@inproceedings{GammelliEtAl2021,
author = {Gammelli, D. and Wang, Y. and Prak, D. and Rodrigues, F. and Minner, S. and Pereira, F. C.},
title = {Predictive and Prescriptive Performance of Bike-Sharing Demand Forecasts for Inventory Management},
year = {2021},
note = {Submitted},
}
In case of any questions, bugs, suggestions or improvements, please feel free to contact me at daga@dtu.dk.