flight delays and cancellations

29
Flight Delays and Cancellations Asad Zaidi Soubhi Hadri Department of Electrical and Computer Engineering The University of Oklahoma December, 2017 EDA & Flight delay prediction

Upload: university-of-oklahoma

Post on 23-Jan-2018

39 views

Category:

Engineering


1 download

TRANSCRIPT

Page 1: Flight delays and cancellations

Flight Delays and

Cancellations

Asad Zaidi Soubhi Hadri

Department of Electrical and Computer Engineering

The University of Oklahoma

December, 2017

EDA & Flight delay prediction

Page 2: Flight delays and cancellations

Introduction:

1

• Data was collected and published by the U.S. Department of

Transportation's for 2015.

• It is available on Kaggle.

• The question to answer:

• Which airline should you fly on?

Page 3: Flight delays and cancellations

Dataset Discovery :

2

Dataset contains three CSVs files:

1- airlines.csv

Page 4: Flight delays and cancellations

Dataset Discovery :

3

Dataset contains three CSVs files:

2- airports.csv

Page 5: Flight delays and cancellations

Dataset Discovery :

4

Dataset contains three CSVs files:

3- flights.csv

Page 6: Flight delays and cancellations

Dataset Discovery :

5

Page 7: Flight delays and cancellations

Exploratory Analysis :

6

Missing Data:

Many NaNs !

Page 8: Flight delays and cancellations

Exploratory Analysis:

7

Negative Delay!

Ahead flights

Page 9: Flight delays and cancellations

Exploratory Analysis:

8

Page 10: Flight delays and cancellations

Exploratory Analysis:

9

Page 11: Flight delays and cancellations

Exploratory Analysis:

10

Best Airlines :

ON_TIME_PER

Page 12: Flight delays and cancellations

Exploratory Analysis:

11

Best Airlines :

MEAN_DEPARTURE_DELAY

Page 13: Flight delays and cancellations

Exploratory Analysis:

Best Airlines :

MEAN_DEPARTURE_AHEAD

12

Page 14: Flight delays and cancellations

Exploratory Analysis:

Best Airlines :

CANCELLED_PERCENTAGE

13

Page 15: Flight delays and cancellations

Exploratory Analysis:

Best Airlines :

CANCELLATION_REASONS

14

Page 16: Flight delays and cancellations

Exploratory Analysis:

Best Airlines :

DIVERTED_FLIGHTS

15

Page 17: Flight delays and cancellations

Exploratory Analysis:

16

The same for ARRIVAL_TIME

Page 18: Flight delays and cancellations

Exploratory Analysis:

17

Page 19: Flight delays and cancellations

Exploratory Analysis:

18

Page 20: Flight delays and cancellations

Exploratory Analysis:

Best Airlines :

MEAN_SPEED

19

Page 21: Flight delays and cancellations

Exploratory Analysis:

Best Airlines :

Simple ranking using:

• MEAN_SPEED

• MEAN_DEPARTURE_DELAY

• MEAN_DEPARTURE_AHEAD

• CANCELLED_PERCENTAGE

• DIVERTED_FLIGHTS

20

Page 22: Flight delays and cancellations

Flight Delay Prediction

Page 23: Flight delays and cancellations

Flight Delay Prediction

• Convolution Neural Network.

• Tensorflow – Python.

• Columns:

• AIRLINE

• DAY_OF_WEEK

• ORIGIN_AIRPORT

• DESTINATION_AIRPORT

• DISTANCE

• DEPARTURE_DELAY

21

Page 24: Flight delays and cancellations

Flight Delay Prediction

Steps:

• Remove :

• DEPARTURE_DELAY<0

• CANCELLED

• DIVERTED

• Encode (using One hot encoding):

• AIRLINE

• ORIGIN_AIRPORT

• DESTINATION_AIRPORT

22

Page 25: Flight delays and cancellations

Flight Delay Prediction

23

Page 26: Flight delays and cancellations

Flight Delay Prediction

24

• Regression:

• 5 convolution layers.

• 2 pooling layers.

• 2 full connected layers _ dropout.

• loss function : square mean.

• Bad results!

• Reasons (maybe):

• Not able to use full dataset.

• Inappropriate encoding.

• Network structure.

First Try:

Page 27: Flight delays and cancellations

Flight Delay Prediction

25

• Convert the problem from regression to classification.

• Spread delay values into 5 levels.

• Use CNN structure similar to AlexNet.

• Result:

• Still running :D .

Second Try:

Page 28: Flight delays and cancellations

Script on GitHub: https://github.com/SubhiH/Flight-Delays-and-Cancellations-EDA

Page 29: Flight delays and cancellations

Thank you