KatInterview

Fixing a Binary Classification Model for Flight Delays

Statistics & ExperimentsModel answer
HardModel answerStatistics & Experimentslogistic-regressionfeature-engineeringdata-quality

Last updated

Identify and correct statistical errors in a flight delay prediction model, including inappropriate regression choice, feature encoding issues, and data quality problems.

A data science team built a model to predict whether flights will be delayed by more than 15 minutes. They used ordinary least squares (OLS) regression with these features:

  • day_of_week: encoded numerically as 1 through 7
  • flight_seats: aircraft capacity (contains some negative values from upstream ETL bugs)
  • Several operational timing variables that are highly correlated with each other

Their target variable is binary: 1 if the flight was delayed more than 15 minutes, 0 otherwise.

Address each of these modeling issues:

1) Model selection: Explain precisely why OLS is unsuitable for this binary target. Recommend an appropriate alternative, stating its distributional family, link function, core assumptions, and practical methods to validate those assumptions.

2) Day-of-week encoding: Demonstrate why treating weekdays as a numeric sequence 1–7 introduces bias. Suggest a better encoding scheme and describe how to statistically test whether day-of-week matters at all.

3) Data integrity: Propose a sound strategy for handling the negative seat counts and any missing data. Discuss how different imputation approaches affect both bias and variance in your coefficient estimates.

4) Correlated predictors: Define the variance inflation factor (VIF) and show mathematically why VIF_j = 1/(1 − R²_j). If one operational variable has VIF = 12, interpret what this means. List three methods to address this issue, explaining the trade-offs of each. Also clarify how feature standardization impacts both coefficient interpretation and multicollinearity detection.

5) Model assessment: Recommend evaluation metrics suitable for a binary outcome with imbalanced classes. Design a cross-validation strategy that prevents temporal information leakage, and explain how to ensure your predicted probabilities are well-calibrated.

Hints

Hint 1

For binary outcomes, consider what happens when a linear model predicts values outside [0,1] and how error variance changes with the prediction

Hint 2

Treating sequential categories as numbers assumes equal spacing and monotonic effects—test whether removing this constraint improves fit

Hint 3

High VIF means a predictor is nearly a linear combination of others; this inflates standard errors but doesn't necessarily hurt predictions