1 of 8

Predicting

Flight Delays

Prashanta & Matt

2 of 8

Motivation:

Flight delays cost airlines $22B/yearly

DataSet:

  • 2018-2019 US Domestic Flights

3 of 8

Project Workflow

  • Created baseline model without any features

  • Optimized dataset
    • Added key features for modelling
    • Removed outliers and missing values

Define Problem & Gather Data

Exploratory Data Analysis (EDA)

Data

Preparation

Modeling

  • Online Research about flights and delays

  • Used Postgres & SQL to collect data

  • Started EDA

  • Created project timeline
  • Looked for trends within data

  • Completed exploratory_analysis notebook

Day 1

Day 2 - 3

Day 4 - 5

Day 6 - 7

Submission

Day 7

  • Models utilized:
    • ADA boost
    • Elastic Net
    • Naive Bayes
    • Poly Regression
    • Random Forests
    • Gradient Descent
    • SVR
    • XGBoost

  • Powerpoint presentation

  • Finalized submission file

4 of 8

Insights and Key Relationships

Target variable is normally distributed around 0

Strong relationship between dep_dealy and arr_delay

Minor relationship between taxi_out and arr_delay

Arr_delay per month is relatively consistent ever yearly

The longest arr_delays occurred late at night or very early in the morning

Other Insights:

  • 34% of flights arrive late
  • 34% of flights depart late
  • 24-25% of flights that depart late arrive late (airlines make up lost time)
  • California, Texas, Florida, Illinois & Georgia covered majority of US air traffic (75%)

5 of 8

Feature Importance

  • Added date time features:
    • Month
    • Year
    • Day�
  • Other features:
    • Origin State
    • Origin City
    • Destination State
    • Destination City
    • Route
    • Depart hour
    • Distance

Feature Engineered:

  • By Route, origin city & month
    • Dep_delay (mean)
    • Arr_delay (mean)
    • Taxi_out_route (mean)
    • Taxi_in_route (mean)

Total Features Used:

  • 23 features

6 of 8

Best Results - Test data

Model Type:

Basic linear regression

Optimized linear regression

ElasticNet Classifier

Naive Bayes

Poly Regression

ADA Boost Classifier

Random Forestst

SGD Regressor

SVR

XGBoost

R2 Score:

0.015

0.196

0.191

-0.695

0.222

-0.098

-0.645

-1.96

-0.0

0.174

MAE Score:

23.62

10.66

10.68

14.72

10.49

11.89

15.05

1.9*10^15

11.7

14.22

7 of 8

Biggest Challenges

  • Computation requirement
    • Difficult time running all the models with large enough data sets
    • Required to run some models overnight�
  • Feature Engineering Challenges
    • Mostly weak relationships with target variable prediction �
  • Issues with gathering data using postgres
    • Limitations with the server and/or postgres
    • Very difficult to use random with join when gathering data

8 of 8

Future of the project

Uses of the project

  • With the proper equipment, could expand the dataset, refine the features and teach the models with larger datasets to get a more accurate accuracy rate�
  • Could eventually sell or make the code open source�

  • Could be used by airlines to give real time updates to consumers on the status on their flight