KatInterview

Data Quality Audit for Flight Delay Prediction Models

Machine LearningModel answer
MediumModel answerMachine Learningdata-qualityfeature-engineeringdata-pipelines

Last updated

Perform a comprehensive data quality audit, leakage check, and data contract design for an aviation dataset intended for delay prediction.

You are tasked with auditing a raw flight operation dataset before using it to train a regression model that predicts arrival delay (arr_delay in minutes).

The provided documentation slide claims the dataset contains the following schema:

  • flight_date: String representing local date (YYYY-MM-DD).
  • dep_time / arr_time: String or integer formatted as local HHMM.
  • dep_delay / arr_delay: Integer minutes (negative values indicate early events).
  • cancelled: Binary flag (0 or 1).
  • tail_num: Unique aircraft identifier.
  • origin / dest: 3-letter airport codes.
  • aircraft_type: Optional string.
  • weather_code: Optional integer/string.

Perform a thorough data audit by answering the following key areas:

  1. Concrete Data Quality & Semantic Issues: Detail at least 8 specific high-risk failure modes you must test for (covering timestamp/timezone anomalies, impossible values, data leakage, operational contradictions, and schema drifts).
  2. Detection Logic & Impact Metrics: For each issue, specify exact programmatic detection criteria (SQL/Python pseudo-logic or regex) and define how to measure its impact on model input/target feeds.
  3. Leakage-Safe Mitigation & Validation: Explain how to resolve these errors without introducing target leakage or temporal snooping. Describe the statistical and diagnostic techniques used to verify the fixes.
  4. Data Contract & CI/CD Enforcement: Define a concrete specification for an upstream data contract and describe how to automate validation checks in production pipelines.

Hints

Hint 1

Establish the exact point in time when the prediction is executed. Features available only post-departure or post-arrival must be flagged as leakage.

Hint 2

Local timestamps in HHMM format lack timezone context and offset information, which causes severe errors around Daylight Saving Time (DST) changes.

Hint 3

Target definition: decide how to handle cancelled or diverted flights when defining the modeling dataset versus evaluation metrics.