| Data Type | Count |
|---|---|
| Date | 1 |
| Factor | 24 |
| Numeric | 16 |
An Analysis on Predicting AA1 Departure Delays in CLT2
Data Science 2 with R (STAT 301-2)
1 American Airlines Mainline and Regional
2 Charlotte Douglas International Airport
Introduction & Prediction Problem
This past summer, I had the opportunity to work for American Airlines (AA) at the Charlotte Douglas International Airport (CLT) as an operations analyst intern. Much of the work I did there consisted of predicting and forecasting delays. Being able to predict delays has wider implications on the operation as a whole. For example, one project I worked on while in Charlotte was working on a better staffing solution for baggage runners. To effectively model when the most bags are coming in throughout the day, we needed to know when flights are most likely to come in throughout the day. Over the summer, we built a Monte Carlo simulation to predict flight delays using a single decision tree (this was before I even knew it was called a decision tree). This model proved ineffective on the flight level, but did the job at generally forecasting delays throughout the day.
In this project, we will attempt to more accurately predict departure delay on AA mainline and regional flights departing from CLT in 2024. In future steps, we will use a variety of models for this prediction, and assess which ones perform most successfully. This will be a regression problem.
Data Overview
Data Source
This data was given to me by American Airlines employees.3 The raw data will be unavailable for external viewers of this project. The original raw data combines to include 241,690 rows representing 241,690 flights that were scheduled to depart CLT in 2024. In order to get this combined data, however, I first combined the data from 12 original months of separated data. Before feature engineering, it includes 228 columns which represent various flight factors. Some of the more important variables that may matter more for prediction are Load Factor, Destination, Scheduled Departure Time, Scheduled Turn Time, Right Start Indicator, Aircraft Type, Scheduled Destination Region, and more. For further details on specific variables, viewers can see the codebook4, which contains description of every variable.
3 Due to confidentiality concerns, I am unable to provide references to the data beyond the variables in the codebook.
4 Found in Section 8
In the very first script, we identify some issues with data formats, and make some slight changes to data types to get them to the most representative state for prediction. We can see in Table 1 the types of variables. All told, after omitting the variables which will not use, we have 41 total variables. We will use 40 to predict departure delays.
Data Quality Check
In terms of data quality, we can first look to missing data. We can look at Table 25 to see that out of the 41 total variables that could be missing, we have very minor missingness issues overall. We are missing less than 3% of scheduled and available turn, which is perhaps because of flights that were cancelled before turn was scheduled, but in any case, this error is small enough to omit. The miles variable is missing almost 15% of the time. This is not ideal, but ultimately prediction is still possible with this missingness. We are also missing load factor, onboard mail weight, and onboard freight weight in less than 3% of cases. This should not be detrimental for prediction. Finally, and most importantly, we are missing Departure Delay6 in less than 2% of cases, this is our predictor, and represents departure delays. This is not ideal, but we will filter these out of the data set immediately, and do the rest of the analysis and prediction using flights that have a non-missing departure delay.
5 Corresponding variable titles can be found in Section 8
6 dpt_var
All of our other missingness is minor, and can likely be attributed to slight errors in data collection.
We can also look at comissingness (Figure 1), which seems to be present, but can likely be attributed to the fact that data misentry for one flight makes it more likely for multiple elements of the data to be misentered.
In terms of other potential issues with data quality, other than the issues mentioned above, as well as slight datatyping mishaps between original month files (which was solved with a function which can be seen in the R script), I received the data in a fairly tidy state.
| Variable | Number Missing | Completion Rate |
|---|---|---|
| dpt_gate | 76 | 0.999 |
| skd_tail | 72 | 0.999 |
| dpt_var | 4172 | 0.982 |
| skd_txot | 1 | 0.999 |
| skd_turn | 9866 | 0.959 |
| avail_turn | 9077 | 0.962 |
| miles | 34890 | 0.855 |
| lf | 3555 | 0.985 |
| onbrd_rev_pax | 2271 | 0.990 |
| onbrd_freight_weight | 4954 | 0.979 |
| onbrd_mail_weight | 3243 | 0.986 |
Target Variable Analysis
Examining the target variable, departure delay, several fascinating trends emerge. In terms of shape, the distribution seems to be normal, but with a much higher rate of decay in the negative direction than in the positive direction. We see this in Figure 2.7 This intuitively makes sense, as when a flight departs early, there is generally a tight range for how early it can depart. On the contrary, when a flight departs late, the lateness can skew much farther towards the right side. Because of the normal distribution of this data, I believe no transformations need to be made for predicting departure delay. The data seems centered around -2 minutes of departure delay, representing a median early departure. This can also be verified in Table 3. While there are certainly are outliers on the right side of the distribution, because we have so many data points, they will end up not making quite a difference in the predictions. Looking at the right side of Figure 2, we can see that the spread of the data is relatively tight, with most flights departing between 5 minutes early and 14 minutes late.
7 ChatGPT aided in the creation in this graphic by figuring out how to facet wrap two graphs of different scales on to each other.
| Mean | Standard Deviation | Minimum | First Quartile | Median | Third Quartile | Maximum |
|---|---|---|---|---|---|---|
| 16.28277 | 54.12506 | -275 | -5 | -2 | 14 | 999 |
Methods
Assessment Metric
For this project, we will be using Root Mean Square Error (RMSE) to assess the accuracy of our models. A given RMSE for a model is preferable because it will give us an interpretable number for how close our delay predictions are. An RMSE of \(x\) will tell us that we are \(x\) minutes off, on average, for that given model. In addition, when assessing final models, we will also explore the \(R^2\) coefficient and Mean Absolute Error (MAE) as well.
Data Splitting
There is no lack of data for this project. I was given a complete dataset of 237,518 flights in 2024 which took off from CLT. Due to computational restraints, we will take 40,000 of them for prediction and assessment. In our initial split, we utilize a standard 80/20 split, whereby we take 80%, or ~32,000 observations for the training of our models, and 20%, or ~8,000 observations for the testing of our models. We stratify by our target variable, which is departure delay.
Resampling
To best avoid data leakage, we use a repeated cross-validation resampling method when training our models. This method uses leave-one-out cross-validation, and we use 5 folds and 3 repeats for our setup. This is done so as not to train too many models. Because of our large number of observations, we can trust that 15 total trainings per model is more than sufficient to glean an estimate for model proficiency. As is customary, when setting up our data folding, we once again stratify on our target variable, which is departure delay.
Recipes
For this project, we have defined seven main recipes (preprocessing steps) for our analysis. Three of which are for linear models, and four of which are for tree based models. A good overview of our recipes is outlined in Table 4. Something to highlight is the difference between short term and long term recipes. Our short term recipes use variables which are not known up until the moment the flight departs. Some examples of this are Load Factor (LF), Departure Gate, and Actual Turn Time. This makes for great predictions, but is less useful for more broad workforce planning purposes, where schedules are often made based on delays which must be predicted many months out. For this purpose, we also include analysis on long term recipes, which use only variables which would be known with the release of a schedule. For example, we can still use variables like scheduled departure time, scheduled fleet, and scheduled destination. These recipes expectedly perform worse, but when performing final model analysis, we choose both a superior model for our best long term recipe, and one for our best short term recipe.
8 This is by no means a complete discussion of how these recipes vary. Another main way they vary is in the complexity of their dummy factoring. There are a lot of factors with a high number of levels, and care was taken to consider different ways to treat those more rare seen levels. These different mechanisms vary greatly across recipes. For details on this, one can see the recipe R script via the Github Link.
| Recipe Steps/Goals | LR19 | LR210 | LR311 | TR112 | TR213 | TR314 | TR415 |
|---|---|---|---|---|---|---|---|
| Recipe Goal16 | ST | ST | LT | ST | ST | LT | LT |
| Recipe Complexity17 | S | C | C | S | C | C | C |
| Logarithmic/Exponential Transformation | \(\checkmark\) | ||||||
| Mutations for added Variables | \(\checkmark\) | \(\checkmark\) | \(\checkmark\) | \(\checkmark\) | \(\checkmark\) | ||
| Imputation Method for missing variables18 | \(\checkmark\) | \(\checkmark\) | \(\checkmark\) | \(\checkmark\) | \(\checkmark\) | \(\checkmark\) | \(\checkmark\) |
| Adding Splines for non-linearity | \(\checkmark\) | ||||||
| Step Novel for potential new factor levels | \(\checkmark\) | \(\checkmark\) | \(\checkmark\) | \(\checkmark\) | \(\checkmark\) | ||
| Interaction for Colinear Terms | \(\checkmark\) | ||||||
| Principal Component Analysis (PCA) | \(\checkmark\) |
9 Linear Recipe 1
10 Linear Recipe 2
11 Linear Recipe 3
12 Tree Recipe 1
13 Tree Recipe 2
14 Tree Recipe 3
15 Tree Recipe 4
16 ST = Short Term, LT = Long Term
17 S = Simple, C = Complex
18 In all cases, we impute the median for numeric variables and mode for factor variables for computational efficiency.
| Recipe | Number of Predictor Columns19 |
|---|---|
| LR1 | 61 |
| LR2 | 18520 |
| LR3 | 102 |
| TR1 | 7021 |
| TR2 | 15122 |
| TR3 | 7023 |
| TR4 | 151 |
19 We say predictor columns rather than predictors, because when we take steps like dummying factors, adding in interaction variables, and other mutations, we end up with more columns to predict on than actual predictors in our original dataset.
20 The main reason for the large variation in columns between our simple and complex recipes is for our forcing of non-near-zero-variance factoring. In our simple recipes, we dummy all factors and then run a near zero variance command to omit all of our factors with near zero variance. This wholly omits factors like destination, upline origin, and others. In our complex recipes, we force at least a small number of those upline origins and destinations to be considered through non-trivial dummying of those two variables (outlined in Section 3.4.4).
21 This recipes happens to have the same number of predictor variables as TR3 by coincidence, they use different predictor variables.
22 This recipe happens to have the same number of predictor variables as TR2 by coincidence, they use different predictor variables.
23 This precise number was achieved through PCA.
Log/Exponential Transformations
For LR2, we include a log and exponential transformation on several variables. This is due to a skewed relationship with the target variable (departure delay). We can see in Figure 3 that scheduled block time, scheduled air time, scheduled taxi out time, onboard non-revenue passengers, onboard mail weight, and onboard freight weight are all numeric predictors skewed to the left in their distribution with departure delay. As such, we include a log transform on those predictors. For Load Factor, we can see this has a distribution skewed to the right, so we include a exponential transformation on that variable. For both log and exponential transformations, we use a standard base 10 transform.
Spline Transformations
Some variables have non-linear relationships with departure delay. We can see in Figure 4 that there are several variables that could likely benefit from seeing splines added to account for polynomial distributions between themselves and the target variable. As such, for MOGT and Seats, we add 10 natural splines, and for Scheduled Block, we add 5 natural splines. The justification for this can be seen in Figure 14, Figure 15, and Figure 16.
Interaction Transformations
For linear models, we must decorrelate highly correlated predictor variables. While ideally, we decorrelate all variables which are correlated more than 0.75, due to computing restraints and the number of new predictors it would create, we only decorrelate those variables with more than 0.9 correlation, and trust that in models like our elastic net, for example, that much of the correlation is taken care of through penalty. We can see in Table 624 those variables which we decorrelate in our complex linear recipe.
24 ChatGPT aided in the creation of this table with help in discovering the reshape::melt() function.
| Variable 1 | Variable 2 | Correlation |
|---|---|---|
| Miles | Scheduled Air Time | 0.971 |
| Scheduled Air Time | Scheduled Block Time | 0.966 |
| Miles | Scheduled Block Time | 0.947 |
| Seats | MOGT | 0.910 |
| Seats | Flight Number | -0.905 |
| Available Turn Time | Scheduled Turn Time | 0.904 |
Other Transformations
We also include several other non-trivial steps in our complex recipes. We include a month and weekday variable to account for differences in behavior based on time of the year and time of day. We also create a bank variable to account for timing. The banked schedule is used in CLT, and the banks were used based on the departure bank definitions provided at the beginning of 2024. We also include the concourse the flight took off from25. Rather than include all gates analysis, we consider only concourse due to the amount of dummying it would take to include analysis on over 100 gates. We also include dummying for destination in a non-trivial way. We take those destinations which are serviced in more than 1% of flights, and give them their own factor. The rest get lumped into an other category.26 We do this same 1% threshold for upline origin. Finally, we include four new numeric variables concerning popularity of various factors. Destination popularity is the proportion of flights out of CLT (from the given dataset, whether folds, training, or testing) that went to that observations destination. We do the same for gate, upline origin, and tail number.
25 This applies only to ST recipes.
26 This comes after a non-zero variance step to make sure we keep our destinations serviced above 1% of the time represented. Within other complex recipes, this method varies slightly. Complete details should be observed in the recipes script.
Principal Component Analysis
While extracurricular, we try our hand at using a recipe with PCA. Rather than tuning the number of predictors we mutate, we make an assumption that 70 is sufficient. It can be observed in Section 4.2 that this was likely not the case. For future iterations of this project, we would tune the number of predictors we create using PCA.
Model Building & Selection
We trained in total nine different types of models, almost all of which we trained on all available recipes. We tuned all of those models where applicable. Table 7 summarizes each model with it’s total number of model variations (for tuned models) and its total number of trainings (on resamples).
| Model Type | Recipe Used | Number of models | Total number of trainings |
|---|---|---|---|
| Baseline27 | LR1 | 1 | 15 |
| Baseline28 | LR3 | 1 | 15 |
| Cubist | TR1 | 50 | 750 |
| Cubist | TR2 | 50 | 750 |
| Cubist | TR3 | 50 | 750 |
| Cubist | TR4 | 50 | 750 |
| Ordinary Linear Regression (OLS) | LR2 | 1 | 15 |
| Null | LR129 | 1 | 15 |
| Boosted Tree (BT) | TR1 | 50 | 750 |
| Boosted Tree | TR2 | 50 | 750 |
| Boosted Tree | TR3 | 50 | 750 |
| Boosted Tree | TR4 | 50 | 750 |
| Elastic Net (EN) | LR1 | 2,50030 | 37500 |
| Elastic Net | LR1 | 2,500 | 37500 |
| K-Nearest Neighbors (KNN) | TR1 | 30 | 450 |
| K-Nearest Neighbors | TR2 | 30 | 450 |
| K-Nearest Neighbors | TR3 | 30 | 450 |
| K-Nearest Neighbors | TR4 | 30 | 450 |
| Neural Networks (NN) | TR1 | 50 | 750 |
| Neural Networks | TR2 | 50 | 750 |
| Neural Networks | TR3 | 50 | 750 |
| Neural Networks | TR4 | 50 | 750 |
| Random Forest (RF) | TR1 | 50 | 750 |
| Random Forest | TR2 | 50 | 750 |
| Random Forest | TR3 | 50 | 750 |
| Random Forest | TR4 | 50 | 750 |
| Total | 5924 | 88860 |
27 Same as OLS, but particularly on LR1 or LR3 (our simple linear recipes).
28 We train two different baseline models to have a point of comparison for both short term and long term recipes.
29 Recipe is irrelevant here, would get same result regardless.
30 The training of this many EN models is an error For consistency, a Latin Hypercube tuning grid was intended, but instead we used a regular grid, causing 50 trials for each level of tuning.
Model Building
We select our nine models with some intentions. We use all models that have been discussed thus far in the course, and also add new ones discussed in the textbook.
Tuning Mechanism
All of our models with the exception of our Elastic Net and K-Nearest Neighbors models are tuned with a Latin Hypercube tuning grid with 50 different hyperparameters selected. To ensure the proper upper and lower bounds were properly met, one can examine Section 9.2. We also do not tune every hyperparameter, only the ones in the scope of the course. The hyperparameters we do tune can be examined in Table 8.
Model Selection
In Table 8, we can see which models perform the best out of each workflow. We extract the best hyperparameters for each.31 Much of this information is also corroborated visually in Figure 5.32 We can enthusiastically report that making more complex models generally seems worthwhile. All models (other than OLS on LR2) outperform the null model, and almost all models outperform the baselines.
31 For details on all 5,924 fits, one can see Table 12 in Section 9.3.
32 This graphic excludes RMSE for OLS on LR2 because it is an extreme outlier due to its underaccounting for colinearity that Elastic Net models take care of more sufficiently.
Short Term Selection
For our best short term model selection, there were several models at the top that were all within a standard error of each other. All of these models were some kind of tree model. We chose to select the Random Forest model using TR1 due to its simplicity. Random Forest models are simpler than Boosted Trees, and recipe 1 is the simplest of our recipes. We will chose the best hyperparameters from this model, which are 45 for the number of variables selected, and 12 for the minimal number of observations at the end of a branch. We should also make sure that we tuned our hyperparameters optimally given this is the model we chose to take into testing. We can see in Figure 6, that as our randomly selected predictors increases, we improve in RMSE, but we see a leveling off indicating that we have found the right value. For minimal node size we see a similar story in the opposite direction. It seems that generally as minimal node size decreases, RMSE increases, but it generally seems that the randomly selected predictors have more sway on the RMSE of the model than does minimal node size. We make this assessment due to the fact that the outliers in RMSE are dispersed more randomly in minimal node size than they are for the randomly selected predictors. Because of this, we are comfortable taking this model into testing.
Long Term Selection
When looking exclusively at long term workflows33, we can see that again tree based models rise to the top of the list. We can also see that in all cases, our TR4 outperforms TR3 when comparing likewise model types. This indicates that our PCA step was not beneficial here. When looking at the RMSE values, we again have a case where our model at the top of the list is a boosted tree model that is within one standard deviation of the next best model, which is a simpler random forest model. As such, we decide to take that random forest model into testing. This model prefers slightly different hyperparameters, with 58 as the number of variables selected, and 2 for the minimal number of observations at the end of a branch. We can see in Figure 7 that similarly to our preferred short term model, we seem to have tuned the correct levels of hyperparameters for both randomly selected parameters and minimal node size.
33 This can be done by going to Table 8 and typing “LT” into the search bar.
Final Model Analysis
After selecting the best models for both our short term recipes and long term recipes, as justified above, we train them on the complete training data and then test them with the testing data. The technical work is done in scripts with prefixes 7 and 8. The assessment and visualization is done in scripts with prefix 9.
Short Term Model
We can see in Table 934 that for our short term final model, we are on average off by 24.2 minutes when penalizing bigger errors more for RMSE. Our MAE indicates that when we do not penalize, we are on average only 9.42 minutes off, on average. Our RSQ indicates that approximately 82.9% of the variation in departure delays can be explained by our model.
34 For Assessment Metric: RMSE = Root Mean Square Error, RSQ = \(R^2\), MAE = Mean Absolute Error.
| Assessment Metric | Estimate |
|---|---|
| RMSE | 24.173 |
| RSQ | 0.830 |
| MAE | 9.428 |
We can see in Figure 8 that our model tends to overpredict delays more than it underpredicts them. With that said, when it underpredicts delays, it generally underpredicts them by a lot. Although not a classification problem, it is interesting to examine Figure 9 where we can see just how prone we are to overpredicting delays rather than underpredicting them. We misclassify delayed departures almost 5 times more often than we misclassify on time departures. In terms of use cases, this is likely ideal, however, since it is best to plan workforce around more conservative assumptions in the operation.
Variable Importance Plot
Although extracurricular, it is interesting to examine a variable importance plot for this random forest model. Unfortunately, Figure 10 only takes into account those non-mutated variables, so variables like destination popularity or even day of the week will not be factored in here. We can see that RON indicator is extremely important in predicting delays. It can be further observed in Section 9.4.1 that aircraft that rest overnight tend to take less departure delay. This is intuitive. Another perhaps counterintuitively high importance variable is scheduled taxi out time. The reason why this may be is discussed in Section 9.4.2.
Long Term Model
We can see in Table 10 that for our long term final model, we are on average off by 31.9 minutes when penalizing bigger errors more for RMSE. Our MAE indicates that when we do not penalize, we are on average only 15.67 minutes off, on average. Our RSQ indicates that approximately 70.4% of the variation in departure delays can be explained by our model. All of these metrics are intuitively lower than the short term recipe. When we do not know some of the factors that happen right before a flight which heavily inform whether or not it will take a delay, we can not as accurately predict its delay.
| Assessment Metric | Estimate |
|---|---|
| RMSE | 31.931 |
| RSQ | 0.704 |
| MAE | 15.673 |
Very similarly with our short term model, we can see that we tend to overpredict delays35, but when we incorrectly predict an on time departure, we err more severely in its actual delay, as seen in Figure 11.
35 As seen in Figure 12.
Variable Importance Plot
The same variables that were important in our short term model are also important in our long term model, but those variables still available jump higher to the top of the list due to the fact that many of the more important variables are no longer present. This is seen in Figure 13. Interestingly, departure date now jumps higher to the top of the list. We offer no justification as for why this is the case.
Conclusion
In this project, we started with a dataset of all AA flights that took off from CLT in 2024 and successfully beat a baseline model for predicted delay on the flight level using two different methods. In one method, we take into account all variables that are known before flight departure, including those not known until right before takeoff. In another, we use only those variables known several weeks in advance.
Potential Errors in Methodology
This likely does not account for all errors, but highlights some of the ones we believe to be perhaps notable in overall results.
Parallel Processing
It should be noted that in all scripts used to tune models, parallel processing was implemented slightly erroneously. We initiated the cluster at the top and bottom of the document rather than immediately before and after a training.
PCA Tuning
For TR3, we use principal component analysis when creating the recipe. In an ideal scenario, the number of predictors we reduce down to would be tuned, but this is not something I was comfortable doing at the time, so I made an assumption that 70 would be sufficient. Based on performance, it likely was not.
Tune More Hyperparameters
For several model types, there were several parameters that were not tuned. Perhaps most importantly, for Random Forest and Boosted Tree models, the number of trees was not tuned. I built these models with an assumption that for sure 250 trees would be enough, and it likely was, but this is not something that I can say for certain, because that value was never tuned. This methodology was done the way it was to save on as much computational work as possible.
More Optimal Tuning of Some Hyperparameters
Most notably, it is possible that we did not find a leveling off point for the epochs hyperparameter in our Neural Networks model tuning.
Future Steps and Explorations
There are several ways this project can be expanded in the future. One way is through the predicting of other unknown factors to produce a better prediction for delay36. For example, in our long term recipes, we do not take into account Load Factor (LF) because it is an element that is not known up until the time of the flight. However, instead of not taking it into account, what we could do is predict it based off of what we already know, and then use the predicted LF to predict departure delay. This could be done for other variables as well, such as give a predicted departure terminal, or a predicted available turn time.
36 This applies to the long term recipes.
Another way this project can be expanded is simply through the use of more models and recipes. We used nine model specifications across seven unique preprocessing steps, but this is by no means a completely comprehensive analysis. Now that we know that tree models tend to perform better, we can go back and create more tree based recipes that we think have the potential to perform better.
Finally, another important future step that can be made is knowing more about variable importance. We do a slight amount of that in this project, but knowing exactly how certain variables affect departure delay could be critically important in planning.
Use Cases
There are several use cases for a model like this. One of them, which is also the motivation for this project, is to better staff baggage runners. Over the summer, I worked on this project and the model I was using to forecast delays did not come nearly as close in precision as this one does. In general, much of workforce planning relies on assumptions in schedule degradation, and having a model that can predict it as accurately as possible is important.
Another use case for a model like this is in consumer information. Apps like the AA app, or even third party apps often give users updates on the potential of their flight to be delayed. These predictions are likely made using models not dissimilar from mine, but perhaps less accurate. These models can very importantly give travelers more peace of mind when flying so they have an idea of what to expect.
References37
Tidy Modeling with R, Max Kuhn and Julia Silge, Accessed 12 March 2025.
37 The raw data is unable to be referenced due to confidentiality concerns.
Appendix A - Technical Info
The following is a quick reference to the codebook for variables used in the CLT Flights dataset:
Appendix B - Additional Plots & Tables
Spline Quantity Justification
The following plots justify why we use the number of splines we use for each variable that we transform with splines. For cases where it seemed like we could use multiple different values, we err on the side of less rather than more in favor of simplifying the already complex LR1 as much as possible.
Boundary Checks for Model Tuning
The following are our boundary checks for each model workflow we tune38. When we use recipe numbers, it can be assumed that the number corresponds to recipe discussed in Section 3.4.39
38 We omit a check on Elastic Net models. This is because we automatically check the whole range (mixture from 0-1 and penalty from 0-1), so we must have found optimal hyperparameters somewhere in that range.
39 For example, Boosted Tree Recipe 1 implies TR1.
We can see in Figure 17, Figure 18, Figure 19, and Figure 20 that we seem to have tuned all hyperparameters appropriately, in that we have a point in which they stop being optimized and we have found it. It also seems that learn rate is the most directly related to RMSE, as both selected predictors and minimal node size do not seem to have as much relation to RMSE.
We can see in Figure 21, Figure 23, Figure 22, and Figure 24 that nearest neighbors seems to be the most directly related to RMSE, and it has a leveling off point near the top end. Unfortunately, the cubist rules specification we were using only allowed for nearest neighbors tuning ranges to be integers between 0 and 9, so while it does not necessarily seem like we have reached a leveling off point for nearest neighbors, it was the highest the tuning could have been.
We can see in Figure 25, Figure 26, Figure 27, and Figure 28 that we seem to have found a leveling off point for our nearest neighbors specification for all four model specifications, but this comes at different points for each of them. It does seem to be related to the number of predictor columns in each recipe. TR1 has the least columns so it needs the least number of neighbors. This hypothesis is somewhat weakened by Figure 27, which does not level off with the same speed as Figure 25 despite having the same number of predictor columns in the recipe.
We can see in Figure 29, Figure 30, Figure 31, and Figure 32 that it is possible that we did not optimally tune Epochs as a hyperparameter. This is already discussed in Section 6.1.4.
In Figure 33 and Figure 34, we can see those Random Forest Models which were not selected to be final models. Similarly to what we have already discussed in Section 4.2.1, they seem to be optimally tuned.
Assessments on All Model Fits in RMSE
The following is our assessment for all fitted model types, including those in the workflow without the best hyperparameters.
Selected Partial Dependence Profiles
Short Term Model
We can see in Figure 35 and Figure 36 that departure delay can be highly predicted based on the amount of available turn time. This should not be particularly surprising. We can see that whenever available turn time is negative (meaning the inbound flight was delayed), we will always predict delays in the outbound. Interestingly, once the available turn time gets above 0, we see relatively constant departure delays. In Figure 35, we see that flights that do not rest overnight are generally more likely to take departure delays. In Figure 36, we can see that flights that are not on T0 are also more likely to depart on time. This is another intuitive realization, but it is good to see it verified in our predictive models.
Long Term Model
We can see in Figure 37 that as scheduled turn time decreases, so too does the likelihood of taking departure delays. This is similar to what we see above, but is slightly less accurate when the turn time is scheduled as opposed to available. We see in Figure 38 that as the scheduled taxi out time increases, the likelihood of taking a delay decreases. This likely has two reasons. The intuitive one is that more time to taxi out creates more of a buffer. We also know that long haul flights tend to get more scheduled taxi out time, and they also tend to take less departure delays; this is likely the second reason.
Appendix C - Comment on Generative AI Use
Generative AI, namely, ChatGPT, is used throughout this project. Where it is used, it is explicitly mentioned in footnotes how it is used. It is used most often to aid in creating new visualizations or tabulations that are not explicitly mentioned in the textbook.