Abhinay.

Reading

Completed2024–2026Data preparation, feature engineering, model training and evaluation

Technical reading

Business reading

Accuracy is not published. The July 2024 record counts are pending re-verification.

ICE Train Delay Prediction

Two tasks on ICE stops: classification at a 6-minute delay threshold, and regression for delay in minutes. Twenty models were compared. Weather comes from Open-Meteo. The July 2024 counts of about 158K original stops and 146K cleaned records are pending re-verification; the public repository includes a synthetic generator. Accuracy is not published.

The question is whether an ICE stop will be six minutes late or more, and by how many minutes. The study is complete as a pipeline. The dataset counts are still being re-verified, and no accuracy number is published.

original ICE stops
≈158K
cleaned records
≈146K
delay classification threshold
6 min
models compared
20
PythonPandasNumPyscikit-learnXGBoostLightGBMCatBoostOpen-MeteoMatplotlib

Stack, architecture and test detail sit in the Technical reading. This view stays with the problem, who it helps, and what is live or still planned.

Project overview

The project predicts two related outcomes for Deutsche Bahn ICE stops: whether a stop will be delayed by six minutes or more, and how many minutes of delay to expect.

It follows a CRISP-DM workflow from business understanding and data preparation through modelling, evaluation and reporting.

The question

Will this ICE stop be delayed by six minutes or more, and by how many minutes? Classification uses that six-minute threshold. A second task estimates the delay itself. Twenty models were compared under one protocol.

Accuracy is not published. The July 2024 figures — about 158,000 original stops and about 146,000 cleaned records — are pending re-verification. The public repository includes a synthetic generator so the pipeline can be rerun without treating those counts as a finished benchmark.

Dataset

  • July 2024 Deutsche Bahn operational dataset
  • Approximately 158K original ICE stops
  • Approximately 146K cleaned records after preparation
  • Hourly weather data from the Open-Meteo archive API
  • Weather variables: temperature, precipitation, rain, snowfall, humidity, cloud cover, pressure, wind and weather code

Data preprocessing

  • Removed duplicate and incomplete stop records
  • Standardized station and train-type fields
  • Handled missing weather observations
  • Joined train and weather data on station, date and hour
  • Created the binary target: delay of 6 minutes or more
  • Kept delay minutes as the regression target

Feature engineering

  • Temporal features: hour, day of week, month, season, weekend and holiday flags
  • Rush-hour and peak-window indicators
  • Weather features and a composite weather-severity signal
  • Lag and rolling delay features
  • One-hot encoding for train type and station

Classification and regression

Twenty models were compared across the two tasks. Classification models were ranked by ROC AUC; regression models were ranked by RMSE.

  • Classification: Logistic Regression, Decision Tree, Random Forest, Gradient Boosting, XGBoost, LightGBM, CatBoost, SVM, KNN and MLP
  • Regression: Linear Regression, Ridge, Lasso, ElasticNet, Random Forest, Gradient Boosting, XGBoost, LightGBM, CatBoost and MLP
  • Evaluation metrics: accuracy, precision, recall, F1 and ROC AUC for classification; MAE, MSE, RMSE, MAPE and R² for regression

Model evaluation

The pipeline produces comparison tables, ranking plots, feature-importance visualizations and a results summary.

The goal is not only the best score, but a model that is understandable enough to support operational planning and passenger communication.

Results

The modelling and evaluation pipeline is complete. Final benchmark metrics are being verified before publication; I have deliberately not published unverified accuracy claims.

What I learned

  • Delay prediction is a data-quality problem before it is a modelling problem.
  • Weather helps, but temporal and operational context matter just as much.
  • A clear threshold and a well-defined target make the business question testable.
  • Model comparison is only useful when the evaluation protocol is consistent.