I trained and compared Linear Regression, Ridge Regression, Random Forest, and KNN to predict delay length in minutes, then evaluated each on three separate slices of the data — combined, arrivals only, and departures only — since delays behave differently depending on which end of the flight you're predicting.
Python · Scikit-learn · Pandas
Flight delay prediction
Predicting U.S. flight delays with four regression models, evaluated separately on arrivals, departures, and the combined dataset, using the DOT flight delay dataset on Kaggle.
Overview
Key results
No single model won across every metric and every subset. Random Forest had the best raw error on the combined data, but Linear and Ridge Regression classified delays more accurately for arrivals specifically, and KNN handled departures — the noisier of the two — best.
Takeaway
Model selection has to depend on the actual use case: minimizing average error (MAE) and correctly flagging "will this be significantly delayed" (F1/classification) aren't the same objective, and the best model changed depending on which one mattered and which leg of the flight was being predicted.