Forecasting freight railway traffic in Morocco: a data-driven machine learning approach for efficient logistics planning
Alaâ Eddine El Moussaoui, Taoufiq El Moussaoui
Mohamed I University · Chouaib Doukkali University
Abstract
Purpose This study develops and evaluates a data-driven forecasting framework for freight railway traffic along Morocco's Tanger–Casablanca corridor, with the objective of assessing whether advanced machine learning models can enhance the accuracy and robustness of medium-term demand forecasting compared to conventional statistical time-series methods, thereby improving both operational railway planning and strategic logistics decision-making. Design/methodology/approach A quantitative research design is employed using sixteen weeks of aggregated data derived from 2,159 operational records collected along the Tanger–Casablanca railway corridor. The dataset integrates multiple sources, including railway operational indicators, port throughput measures, industrial production indices, and macroeconomic variables. The study implements classical statistical models (ARIMA and SARIMA) alongside machine learning approaches, namely Random Forest, Gradient Boosting, Long Short-Term Memory (LSTM), and Prophet. Rigorous preprocessing, feature engineering, rolling-window validation, and multi-metric evaluation (MAE, RMSE, MAPE, and R2) are applied to ensure robust and unbiased model comparison. Findings The results indicate that machine learning approaches consistently outperform traditional statistical models in forecasting freight railway demand. Among all models, LSTM delivers the highest predictive accuracy, followed by Gradient Boosting and Random Forest, while ARIMA and SARIMA serve as baseline benchmarks but show reduced performance during periods of peak demand. The analysis further reveals that port throughput and wagon allocation are the most significant predictors of freight volume, confirming the presence of nonlinear and temporally dependent demand structures that are more effectively captured by advanced learning models. Originality/value This study contributes to the limited empirical literature on railway freight forecasting in developing countries by applying and systematically comparing advanced machine learning techniques within the Moroccan railway context. It introduces an integrated forecasting framework that combines heterogeneous data sources with rigorous validation procedures, thereby bridging the gap between predictive analytics and operational railway decision-making. The proposed approach offers both methodological innovation and practical insights to support the modernization of rail freight systems in emerging logistics environments.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- AI-driven dynamic timetable optimization for the Casablanca-Mohammedia-Rabat commuter railwayRailway Sciences · 2026
- SCOUT: Scenario-Oriented Context-Gated Forecasting with Explicit Lower-Bound Projection for Eligible Railway Coal OD FlowsApplied Sciences · 2026
- Structure-optimized deep forest model for railway port container reloading time prediction: A hybrid integer programming and Bayesian optimization approachAdvanced Engineering Informatics · 2026
- Short-Term Traffic Congestion Forecasting Using Machine Learning and Deep Learning Models for Spatiotemporal Traffic AnalysisApplied Sciences · 2026
- Comparative Evaluation of Traffic Load Prediction Models for Intelligent Transportation Systems Using High-Resolution Urban DataSmart Cities · 2026
- Artificial intelligence for integrating railway freight into multi-actor supply chains: insights from machine learning, deep learning and neural networksRailway Sciences · 2026