Prediction Model Framework used in the thesis "Predictive Fleet Strategy for Ridesourcing Services in Reference to Munich's Taxi System" (2022) by Michael Wittmann, M. Sc. at the Institute of Automotive Technology (FTM) at Technical University Munich (TUM).
This project uses poetry for managing the dependencies. You can find the installation instructions for your platform here.
After cloning the repository, you just need to run poetry install, in order to install all required packages.
If you plan to work on the code/repository, please also run pre-commit install to install some pre-commit hooks,
so that the repository stays in a clean state.
After running poetry install, you can either use the built-in demandprediction cli, which runs a prediction model based on the given config file.
If you want to use a config.ini file use demandpredciton --config myconfig.ini
If you prefer to run a python script you can also use the main.py script.
If you want to use the GPU to train your TensorFlow models you need to set the environment variable targeting your CUDA install directory e.g. LD_LIBRARY_PATH=:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda-10.2/targets/x86_64-linux/lib.
demandprediction
├───data
│ ├───evaluation # generated
│ ├───logs # generated
│ ├───models # generated
│ ├───prediction_analysis # generated
│ ├───predictions # output directory
│ ├───train_test # cache for preprocessed input data
│ └───visualization # generated
├───demandprediction # all important files are in this directory
│ ├───prediction
│ │ ├───generators # generators for feeding the models with the needed data
│ │ ├───layers # custom layers for neural networks
│ │ ├───model # models for generating predictions
│ │ ├───preprocessing # preprocessing and modification of the base data
│ │ └───postprocessing # error measures and postprocessing
│ ├───utils # shared filenames and utilty functions
│ └───main.py # main script which starts the prediction
├───myconfig.ini # Configuration File. Models and input data sources can be configured by the parameters in this file
└───pyproject.toml # Toml file which specifies all project dependenciesCopy the default_config.ini and set your parameters:
cp ./default_contig.ini ./myconfig.ini[prediction]
demand_input=./data/example/historic_demand_munich_example.csv ; A csv file containing the demand information
events_input=./data/example/events.csv ; A csv file containing the event information
crs='EPSG:25832' ; coordinate system used for input and outputs (Reccomended to use a metric system)
data_directory=./data ; data directory relative to wkd
start_date=2018-12-31 00:00:00 ; start of prediction interval
stop_date=2020-01-06 06:00:00 ; end of prediction interval
lags=36 ; number of lags used for prediction. Caution!: lagsize and step_size are dependent
number_of_grid_rows=8 ; number of grid rows
number_of_grid_columns=8 ; number of grid columns
x_min=687412 ; x_min grid_boarders in EPSG:25832
x_max=695412 ; x_max grid_boarders in EPSG:25832
y_min=5331314 ; y_min grid_boarders in EPSG:25832
y_max=5339314 ; y_max grid_boarders in EPSG:25832
border_width=5000 ; boarder with in m
number_of_filters=30 ; number of filters used in LSTM-Model
kernel_size=2 ; kernel size of convolution layer
batch_size=24 ; batch size
learning_rate=0.001 ; learning rate for neuronal networks
step_size=20 ; time series frequency in min. Caution lagsize and ste_szie are dependent
epochs=500 ; number of training epochs
prediction_horizon=1 ; number of lags in prediction horizon
You can find an artificial randomized dateset in data/example/historic_demand_munich.csv and /data/example/events.csv
Please Note: This Dataset is for demonstration purposes only and won't produce any meaningful results. It should rather serve as an example how your input data needs to be formatted. The only model that is worth to run with this dataset is the persistence model.
Abstract model framework for further implementations
ConvLSTM with n x m square inner grid and 4 border LSTM cells
ConvLSTM with n x m square inner grid and 4 border LSTM cells with multistep prediction
Global LTSM Model
LSTM with n x m square inner grid and 4 border LSTM cells
LSTM with n x m square inner grid and 4 border LSTM cells with multistep prediction
ConvLSTM Model with additional event MLP Model
###conv_lstm_model.py
n x m square grid lstm model
Historical average model
Persistence model
SARIMAX Model with n x m square grid
SARIMAX Model with n x m square inner grid and 4 border cells
- Michael Wittmann
- Maximilian Speicher
- Jan Koch
- M. Wittmann, "Prädiktive Flottenstrategie für Ridesourcing-Dienste am Beispiel des Münchner Taxiverkehrs", Technische Universität München, 2022. Available at: mediaTUM
If you find our work useful in your research, please consider citing:
@phdthesis {
author = "Wittmann, Michael",
title = "Prädiktive Flottenstrategie für Ridesourcing-Dienste am Beispiel des Münchner Taxiverkehrs",
type = "Dissertation",
school = "Technische Universität München",
address = "München",
year = 2022
}