Code for the paper: "How effective are discrete-continuous multi-task learning compared to single-output models? Insights from travel mode and departure time analysis" — published in Expert Systems with Applications (2025).
This repository implements and benchmarks Multi-Task Learning (MTL) models that simultaneously predict:
- 🚗 Travel mode choice (discrete output — e.g., car, transit, walking, cycling)
- 🕐 Departure time (continuous output — e.g., hour of departure)
The core idea: these two decisions are made jointly by travellers, so training a shared model that leverages their correlation outperforms two independent single-output models.
Key result: MTL increased travel-demand prediction speed by 40% and improved forecasting accuracy by 20% over single-output baselines.
Input Features (socio-demographics, trip attributes, land use)
│
┌────┴─────┐
│ Shared │ ← Shared representation layers (captures joint patterns)
│ Layers │
└────┬─────┘
│
┌─────┴──────┐
│ │
Mode Head Departure Head
(Softmax) (Linear / Beta)
│ │
Mode Departure
Prediction Time
- Discrete-continuous MTL — Handles one categorical and one continuous output simultaneously
- Multiple architectures tested — Hard parameter sharing, soft parameter sharing, task-weighted loss
pip install tensorflow pandas numpy scikit-learn shap matplotlib seaborn jupytergit clone https://github.com/mkhalil91/Multi-task-Learning.git
cd Multi-task-Learning
jupyter notebookOpen MTL_Travel_Behaviour.ipynb and follow the step-by-step pipeline:
- Data preparation — Encoding, normalisation, train/test split
- Baseline models — Single-output MNL, RF, XGBoost
- MTL models — Hard sharing, soft sharing, and weighted variants
- Evaluation — Accuracy (mode), MAE/RMSE (departure time), training time
If you use this code in your research, please cite:
@article{khalil2025multitask,
title={How effective are discrete-continuous multi-task learning compared to single-output models?
Insights from travel mode and departure time analysis},
author={Khalil, Mohamad and Fatmi, Mahmudur Rahman},
journal={Expert Systems with Applications},
volume={274},
pages={127002},
year={2025},
publisher={Elsevier}
}