Yoel125 commited on
Commit
1ccd450
·
verified ·
1 Parent(s): 529205a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +44 -0
README.md CHANGED
@@ -112,3 +112,47 @@ This visual confirmation ensures that the groups created by the K-Means algorith
112
 
113
  ![image](https://cdn-uploads.huggingface.co/production/uploads/69c79aa8f856b118f80df631/oVyGiFtEU_f4miqJwzIpN.png)
114
  This shows that passengers are grouped into three distinct "service profiles" based on their ratings. This creates a meaningful "travel profile" feature, allowing us to test how different passenger experiences impact flight delays in our main research question.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
 
113
  ![image](https://cdn-uploads.huggingface.co/production/uploads/69c79aa8f856b118f80df631/oVyGiFtEU_f4miqJwzIpN.png)
114
  This shows that passengers are grouped into three distinct "service profiles" based on their ratings. This creates a meaningful "travel profile" feature, allowing us to test how different passenger experiences impact flight delays in our main research question.
115
+
116
+ # Part 5: Model Training & Evaluation
117
+ In this section, I compared three different machine learning algorithms to determine the most accurate model for predicting flight arrival delays using the engineered features.
118
+ #### 1. Updated Linear Regression (Refined Baseline)
119
+ re-trained the Linear Regression model using the full set of features, including the new K-Means passenger profiles and encoded categorical variables.
120
+ This allowed me to see how much the additional feature engineering improved the initial baseline performance.
121
+ ### 2. Decision Tree Regressor
122
+ implemented a Decision Tree model to capture non-linear relationships between the features.
123
+ To prevent overfitting, I set a max_depth=5, ensuring the model remains generalized and performs well on unseen data.
124
+ ### 3. Random Forest Regressor (Ensemble Method)
125
+ trained a Random Forest model consisting of 100 individual trees.
126
+ By averaging the predictions of multiple trees, this ensemble approach typically reduces error and provides a more stable R^2
127
+ score compared to a single decision tree.
128
+ ### 4. Performance Comparison & Visualization
129
+ created a Comparison Bar Chart to visualize which model explains the highest percentage of variance in arrival delays, making it easy to identify the top-performing algorithm.
130
+ ![image](https://cdn-uploads.huggingface.co/production/uploads/69c79aa8f856b118f80df631/rPEwtAabowCwz5O5_FH7O.png)
131
+ we cam see that the Random Forest model is the winner because it aggregates multiple decision trees, which reduces variance and prevents overfitting, leading to more stable and accurate predictions for arrival delays.
132
+ Part 7: Regression-to-Classification
133
+ In this section, I reframed the original regression problem (predicting the exact number of delay minutes) into a classification problem. This allows for a different strategic approach to understanding flight punctuality.
134
+
135
+ # Part 7
136
+ ### 7.1 Creating Classes from Numeric Target
137
+ Conversion Strategy:applied a Business Rule Threshold to convert the continuous target into discrete categories.
138
+ Threshold Selection:defined the cutoff point at 0 minutes.
139
+ From an operational perspective, any flight arriving even one minute after its scheduled time is considered delayed.
140
+ Therefore:
141
+ Class 0 (On-Time/Early): Arrival delay ≤ 0 minutes.
142
+ Class 1 (Delayed): Arrival delay > 0 minutes.
143
+ Implementation: This transformation was applied consistently to both the training and testing sets to ensure the validity of the classification models.
144
+ ### 7.2 Class Balance Analysis
145
+ The results show the classes are well-balanced with 55% delayed and 45% not delayed flights.
146
+ Since the groups are almost equal, our model can learn from both types of data effectively.
147
+ ![image](https://cdn-uploads.huggingface.co/production/uploads/69c79aa8f856b118f80df631/FOYjMrNglJ4SnKVfwDQ1X.png)
148
+ # Part 8: Classification Model Evaluation & Results
149
+ In this final analytical stage, I evaluated the three trained classifiers using Confusion Matrices to understand their prediction patterns and error types.
150
+ ### Model Performance Analysis:
151
+ Logistic Regression: This model served as a strong baseline, achieving the highest number of True Negatives (10,380). It is highly reliable at identifying on-time flights but struggle with a significant number of False Negatives (3,079), meaning it often misses actual delays.
152
+ Decision Tree: While it captured the highest number of True Positives (5,989), it suffered from the highest rate of False Positives (2,974). This indicates that the single tree is prone to "over-detecting" delays, leading to many false alarms.
153
+ Random Forest: This model provided the most balanced performance. It maintained a high count of True Negatives (9,596) while successfully identifying 5,902 delayed flights with significantly fewer false alarms than the Decision Tree.
154
+ ![image](https://cdn-uploads.huggingface.co/production/uploads/69c79aa8f856b118f80df631/TZzzpOliTb8WGjzw8W9PM.png)
155
+ ![image](https://cdn-uploads.huggingface.co/production/uploads/69c79aa8f856b118f80df631/X2R8v3yyBl3Op-6KrC9Ny.png)
156
+ ![image](https://cdn-uploads.huggingface.co/production/uploads/69c79aa8f856b118f80df631/oYWz2NUXdC0qmirSp50tU.png)
157
+ The Random Forest model is the overall winner for this task. It offers a superior trade-off between precision and recall, making it the most robust tool for predicting
158
+