avihayamor commited on
Commit
1b164ed
·
0 Parent(s):

Duplicate from avihayamor/US_flight-delay-2024

Browse files
.gitattributes ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ q4_heatmap.png filter=lfs diff=lfs merge=lfs -text
2
+ q3_map.png.png filter=lfs diff=lfs merge=lfs -text
3
+ q3_map.png filter=lfs diff=lfs merge=lfs -text
4
+ Data[[:space:]]Science[[:space:]]Vid.mp4 filter=lfs diff=lfs merge=lfs -text
5
+ banner.png filter=lfs diff=lfs merge=lfs -text
Assignment_1_EDA_&_Dataset_Avihay_Amor.ipynb ADDED
The diff for this file is too large to render. See raw diff
 
Data Science Vid.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ef15857eb37a1b4addada16515aee8d3d96e4f90fc784ef574ef1b88fc276f89
3
+ size 124901790
README.md ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: mit
5
+ task_categories:
6
+ - tabular-regression
7
+ pretty_name: US Flight Delay 2024
8
+ modalities:
9
+ - tabular
10
+ size_categories:
11
+ - 100K<n<1M
12
+ tags:
13
+ - aviation
14
+ - flights
15
+ - delays
16
+ - machine-learning
17
+ ---
18
+
19
+ ![Banner](https://huggingface.co/datasets/avihayamor/US_flight-delay-2024/resolve/main/banner.png)
20
+
21
+ # U.S. Flight Delay Dataset — 2024
22
+
23
+ ## Presentation Video
24
+
25
+ <video width="900" controls>
26
+ <source src="https://huggingface.co/datasets/avihayamor/US_flight-delay-2024/resolve/main/Data%20Science%20Vid.mp4" type="video/mp4">
27
+ </video>
28
+
29
+ *For quick reference, the key findings are outlined below.*
30
+ ---
31
+
32
+ ## Dataset Overview
33
+ - **Source:** Kaggle — [Flight Data 2024](https://www.kaggle.com/datasets/hrishitpatil/flight-data-2024)
34
+ - **Size:** 100,000 rows sampled, 35 columns
35
+ - **Target Variable:** `arr_delay` — Arrival delay in minutes (positive = late, negative = early)
36
+ - **Goal:** Predict flight arrival delay in minutes based on scheduled timing, departure performance, and operational metrics.
37
+
38
+ ---
39
+
40
+ ## Data Cleaning Decisions
41
+ - Removed cancelled flights (`cancelled == 0`) — they have no arrival time
42
+ - Removed rows with missing `arr_delay` values
43
+ - Removed extreme outliers: delays below -100 or above +300 minutes (less than 0.3% of data)
44
+ - No duplicate rows were found
45
+
46
+ ---
47
+
48
+ ## Key Findings
49
+
50
+ - Flights that depart late usually arrive late (`0.90 correlation`)
51
+ - Delays build throughout the day and peak around evening hours
52
+ - Florida airports showed the highest average delays in the sample
53
+ - Distance and airtime had almost no relationship with delays
54
+ - Regional and premium carriers performed better on average
55
+
56
+ ---
57
+
58
+ ## Target Variable: `arr_delay`
59
+ The target variable is **arr_delay** (Arrival Delay), which represents the difference in minutes between the scheduled and actual arrival time of a flight.
60
+ - Positive values → the flight arrived late
61
+ - Negative values → the flight arrived early
62
+ - Zero → the flight arrived exactly on time
63
+
64
+ Since arr_delay is a numeric value measured in minutes, predicting it is a regression task..
65
+
66
+ ---
67
+
68
+ ## Research Questions & Insights
69
+
70
+ ### Q1: Which airlines have the highest average arrival delay?
71
+ Airlines operate very differently in terms of scheduling and efficiency. By comparing average arrival delay per carrier, we can identify the most and least punctual airlines.
72
+
73
+ ![Q1](q1_airlines.png)
74
+
75
+ **Insight:** B6 (JetBlue) and NK (Spirit) have the highest average delays (~9–6 minutes late).
76
+ YX (Republic Airways - American Eagle, Delta Connection, United Express) 9E (regional fully owned by Delta), and DL (Delta) consistently arrive ahead of schedule.
77
+ Budget and low-cost carriers tend to run later than regional ones.
78
+
79
+ ---
80
+
81
+ ### Q2: Does the time of day affect arrival delays?
82
+ Flights later in the day may accumulate delays due to earlier flights running behind — the "delay snowball" effect.
83
+
84
+ ![Q2](q2_time_of_day.png)
85
+
86
+ **Insight:** Early morning flights (5–6am) arrive significantly ahead of schedule due to low airport congestion. Delays build up through the day, peaking around 7pm. This confirms that delays cascade as the day progresses.
87
+
88
+ ---
89
+
90
+ ### Q3: Which departure airports have the highest average arrival delay?
91
+
92
+ ![Airport delay map](./q3_map.png)
93
+
94
+ **Insight:** Florida airports (MIA, MCO) are the most delay-prone, likely due to heavy tourist traffic and frequent thunderstorms. MSP, BOS, and ATL tend to perform better on average.
95
+
96
+ [🗺️ Open the interactive map](https://huggingface.co/spaces/avihayamor/flight-delay-map-2024)
97
+
98
+ ---
99
+
100
+ ### Q4: How do numerical features correlate with arrival delay?
101
+ A correlation heatmap shows how strongly each variable relates to the others, helping identify the best predictors of `arr_delay`.
102
+
103
+ ![Q4](q4_heatmap.png)
104
+
105
+ **Insight:** `dep_delay` has a 0.90 correlation with `arr_delay` — by far the strongest predictor. If a flight departs late, it almost certainly arrives late. `carrier_delay` (0.61) and `late_aircraft_delay` (0.63) also contribute significantly. Interestingly, `distance` and `air_time` have almost zero correlation with delays — how far or long a flight is doesn't affect whether it's delayed.
106
+
107
+ ---
108
+
109
+ ## Author
110
+
111
+ **Avihay Amor**
112
+ B.A. Economics & Entrepreneurship
113
+ Reichman University
114
+ 2026
115
+
116
+ ## Files in this Dataset
117
+ - `flight_data_2024_sample.csv` — cleaned sample of 100,000 flights
118
+ - [`Assignment_1_EDA_&_Dataset_Avihay_Amor.ipynb` — full EDA notebook](https://colab.research.google.com/drive/1iqPdkwt78yzJ301YtzQ56ZjyC_DJiX6C?usp=sharing)
119
+ - `q1_airlines.png` — bar chart: average delay by airline
120
+ - `q2_time_of_day.png` — bar chart: average delay by hour
121
+ - `q3_map.html` — interactive map: delay by departure airport
122
+ - `q4_heatmap.png` — correlation heatmap
123
+ - `Data_Science_Vid.MP4` — presentation video
banner.png ADDED

Git LFS Details

  • SHA256: aa7e3d9bf51c4ebd6650580d6ce4a2e28f381d193dcee9b17facf6c4f7a72a92
  • Pointer size: 132 Bytes
  • Size of remote file: 2.2 MB
flight_data_2024_sample.csv ADDED
The diff for this file is too large to render. See raw diff
 
q1_airlines.png ADDED
q2_time_of_day.png ADDED
q3_map.html ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ <html>
2
+ <head><meta charset="utf-8" /></head>
3
+ <body>
4
+ <div> <script type="text/javascript">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>
5
+ <script charset="utf-8" src="https://cdn.plot.ly/plotly-2.35.2.min.js"></script> <div id="2c2ad682-2691-4248-9e19-ea1270136089" class="plotly-graph-div" style="height:100%; width:100%;"></div> <script type="text/javascript"> window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("2c2ad682-2691-4248-9e19-ea1270136089")) { Plotly.newPlot( "2c2ad682-2691-4248-9e19-ea1270136089", [{"customdata":[[-3.58,33.64,-84.43],[4.64,30.19,-97.67],[-8.32,42.36,-71.01],[-0.41,39.18,-76.67],[2.49,35.21,-80.94],[-0.87,32.85,-96.85],[-0.21,39.86,-104.67],[2.78,32.9,-97.04],[-6.23,42.21,-83.35],[-10.25,40.69,-74.17],[3.15,29.65,-95.28],[1.0,29.99,-95.34],[-7.06,40.64,-73.78],[0.33,36.08,-115.15],[0.46,33.94,-118.41],[-12.91,40.77,-73.87],[4.54,28.43,-81.31],[-3.26,41.79,-87.75],[9.69,25.8,-80.29],[-12.41,44.88,-93.22],[-3.14,41.98,-87.9],[0.73,45.59,-122.6],[-4.85,39.87,-75.24],[1.4,33.44,-112.01],[-2.82,35.88,-78.79],[-0.92,32.73,-117.19],[0.66,47.45,-122.31],[0.66,37.62,-122.38],[1.08,40.79,-111.98],[1.62,27.98,-82.53]],"geo":"geo","hovertemplate":"\u003cb\u003e%{hovertext}\u003c\u002fb\u003e\u003cbr\u003e\u003cbr\u003esize=%{marker.size}\u003cbr\u003eAirport=%{text}\u003cbr\u003eAvg Delay (min)=%{marker.color}\u003cextra\u003e\u003c\u002fextra\u003e","hovertext":["ATL","AUS","BOS","BWI","CLT","DAL","DEN","DFW","DTW","EWR","HOU","IAH","JFK","LAS","LAX","LGA","MCO","MDW","MIA","MSP","ORD","PDX","PHL","PHX","RDU","SAN","SEA","SFO","SLC","TPA"],"lat":[33.64,30.19,42.36,39.18,35.21,32.85,39.86,32.9,42.21,40.69,29.65,29.99,40.64,36.08,33.94,40.77,28.43,41.79,25.8,44.88,41.98,45.59,39.87,33.44,35.88,32.73,47.45,37.62,40.79,27.98],"legendgroup":"","lon":[-84.43,-97.67,-71.01,-76.67,-80.94,-96.85,-104.67,-97.04,-83.35,-74.17,-95.28,-95.34,-73.78,-115.15,-118.41,-73.87,-81.31,-87.75,-80.29,-93.22,-87.9,-122.6,-75.24,-112.01,-78.79,-117.19,-122.31,-122.38,-111.98,-82.53],"marker":{"color":[-3.58,4.64,-8.32,-0.41,2.49,-0.87,-0.21,2.78,-6.23,-10.25,3.15,1.0,-7.06,0.33,0.46,-12.91,4.54,-3.26,9.69,-12.41,-3.14,0.73,-4.85,1.4,-2.82,-0.92,0.66,0.66,1.08,1.62],"coloraxis":"coloraxis","size":[11.58,12.64,16.32,8.41,10.49,8.87,8.21,10.78,14.23,18.25,11.15,9.0,15.059999999999999,8.33,8.46,20.91,12.54,11.26,17.689999999999998,20.41,11.14,8.73,12.85,9.4,10.82,8.92,8.66,8.66,9.08,9.620000000000001],"sizemode":"area","sizeref":0.052275,"symbol":"circle","line":{"color":"white","width":1},"opacity":0.85},"mode":"markers+text","name":"","showlegend":false,"text":["ATL","AUS","BOS","BWI","CLT","DAL","DEN","DFW","DTW","EWR","HOU","IAH","JFK","LAS","LAX","LGA","MCO","MDW","MIA","MSP","ORD","PDX","PHL","PHX","RDU","SAN","SEA","SFO","SLC","TPA"],"type":"scattergeo","textfont":{"color":"black","size":10},"textposition":"top center"}], {"template":{"data":{"histogram2dcontour":[{"type":"histogram2dcontour","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"choropleth":[{"type":"choropleth","colorbar":{"outlinewidth":0,"ticks":""}}],"histogram2d":[{"type":"histogram2d","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"heatmap":[{"type":"heatmap","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"heatmapgl":[{"type":"heatmapgl","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"contourcarpet":[{"type":"contourcarpet","colorbar":{"outlinewidth":0,"ticks":""}}],"contour":[{"type":"contour","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"surface":[{"type":"surface","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"mesh3d":[{"type":"mesh3d","colorbar":{"outlinewidth":0,"ticks":""}}],"scatter":[{"fillpattern":{"fillmode":"overlay","size":10,"solidity":0.2},"type":"scatter"}],"parcoords":[{"type":"parcoords","line":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterpolargl":[{"type":"scatterpolargl","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"bar":[{"error_x":{"color":"#2a3f5f"},"error_y":{"color":"#2a3f5f"},"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"bar"}],"scattergeo":[{"type":"scattergeo","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterpolar":[{"type":"scatterpolar","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"histogram":[{"marker":{"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"histogram"}],"scattergl":[{"type":"scattergl","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatter3d":[{"type":"scatter3d","line":{"colorbar":{"outlinewidth":0,"ticks":""}},"marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scattermapbox":[{"type":"scattermapbox","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterternary":[{"type":"scatterternary","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scattercarpet":[{"type":"scattercarpet","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"carpet":[{"aaxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"baxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"type":"carpet"}],"table":[{"cells":{"fill":{"color":"#EBF0F8"},"line":{"color":"white"}},"header":{"fill":{"color":"#C8D4E3"},"line":{"color":"white"}},"type":"table"}],"barpolar":[{"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"barpolar"}],"pie":[{"automargin":true,"type":"pie"}]},"layout":{"autotypenumbers":"strict","colorway":["#636efa","#EF553B","#00cc96","#ab63fa","#FFA15A","#19d3f3","#FF6692","#B6E880","#FF97FF","#FECB52"],"font":{"color":"#2a3f5f"},"hovermode":"closest","hoverlabel":{"align":"left"},"paper_bgcolor":"white","plot_bgcolor":"#E5ECF6","polar":{"bgcolor":"#E5ECF6","angularaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"radialaxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"ternary":{"bgcolor":"#E5ECF6","aaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"baxis":{"gridcolor":"white","linecolor":"white","ticks":""},"caxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"coloraxis":{"colorbar":{"outlinewidth":0,"ticks":""}},"colorscale":{"sequential":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"sequentialminus":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"diverging":[[0,"#8e0152"],[0.1,"#c51b7d"],[0.2,"#de77ae"],[0.3,"#f1b6da"],[0.4,"#fde0ef"],[0.5,"#f7f7f7"],[0.6,"#e6f5d0"],[0.7,"#b8e186"],[0.8,"#7fbc41"],[0.9,"#4d9221"],[1,"#276419"]]},"xaxis":{"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","automargin":true,"zerolinewidth":2},"yaxis":{"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","automargin":true,"zerolinewidth":2},"scene":{"xaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2},"yaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2},"zaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2}},"shapedefaults":{"line":{"color":"#2a3f5f"}},"annotationdefaults":{"arrowcolor":"#2a3f5f","arrowhead":0,"arrowwidth":1},"geo":{"bgcolor":"white","landcolor":"#E5ECF6","subunitcolor":"white","showland":true,"showlakes":true,"lakecolor":"white"},"title":{"x":0.05},"mapbox":{"style":"light"}}},"geo":{"domain":{"x":[0.0,1.0],"y":[0.0,1.0]},"center":{},"scope":"usa","bgcolor":"lightblue"},"coloraxis":{"colorbar":{"title":{"text":"Avg Delay (min)"}},"colorscale":[[0.0,"rgb(5,48,97)"],[0.1,"rgb(33,102,172)"],[0.2,"rgb(67,147,195)"],[0.3,"rgb(146,197,222)"],[0.4,"rgb(209,229,240)"],[0.5,"rgb(247,247,247)"],[0.6,"rgb(253,219,199)"],[0.7,"rgb(244,165,130)"],[0.8,"rgb(214,96,77)"],[0.9,"rgb(178,24,43)"],[1.0,"rgb(103,0,31)"]]},"legend":{"tracegroupgap":0,"itemsizing":"constant"},"title":{"text":"Average Arrival Delay by Departure Airport (Top 30 US Airports)","font":{"size":16}}}, {"responsive": true} ) }; </script> </div>
6
+ </body>
7
+ </html>
q3_map.png ADDED

Git LFS Details

  • SHA256: 8a41ae5e0797746bdf339de34296fc64d221d8ae0ff46d6eab8464d530bfcb38
  • Pointer size: 131 Bytes
  • Size of remote file: 200 kB
q4_heatmap.png ADDED

Git LFS Details

  • SHA256: 71d3c5c12341c208df71db2f4dd9485788897b2ba3b8792d71895a7fba594835
  • Pointer size: 131 Bytes
  • Size of remote file: 113 kB