Model 1: Decision Tree

decsions tree.jpg
 

Model 2: Decision Tree

Our team constructed several decision trees considering the following Age, Class, and distance of travel. We hope that airlines could use this information to cater to specific groups of people following the above categories.

distance_class:

'long': flight distance >= 2000
'short': flight distance < 2000

satisfaction_class:

1: satisfied
0: dissatisfied

age_class:

'young age': age <= 25
'middle age': age > 25 or age <= 40
'old age': age > 40

Seat comfort, Departure/Arrival time convenient, Food and drink, Gate location, Inflight wifi service, Inflight entertainment, Online support, Ease of Online booking, On-board service, Leg room service, Baggage handling, Checkin service, Cleanliness, Online boarding. All ratings are integers with values 0-5.

 
DT1a.png

Decision Tree 1a: {Age: 'young age', Class: 'Business', Distance: 'short'}

0.9315188762071993
[[436  49]
 [ 29 625]]
              precision    recall  f1-score   support

           0       0.94      0.90      0.92       485
           1       0.93      0.96      0.94       654

    accuracy                           0.93      1139
   macro avg       0.93      0.93      0.93      1139
weighted avg       0.93      0.93      0.93      1139
DT_1a: [('Online boarding', 0.4834421661920094), ('Inflight wifi service', 0.32390610016997123)]

Given a {young age} person with a seat in {Business Class} going a {short distance}, the U.S. airlines should focus on improving Inflight wifi service and Online boarding in order to improve customer satisfaction ratings.

DT1b.png

Decision Tree 1b: {Age: 'young age', Class: 'Business', Distance: 'long'}

0.9373493975903614
[[129  12]
 [ 14 260]]
              precision    recall  f1-score   support

           0       0.90      0.91      0.91       141
           1       0.96      0.95      0.95       274

    accuracy                           0.94       415
   macro avg       0.93      0.93      0.93       415
weighted avg       0.94      0.94      0.94       415
DT_1b: [('Online boarding', 0.5485990602613693), ('Inflight wifi service', 0.15330491386716777)]

Given a {young age} person with a seat in {Business Class} going a {long distance}, the U.S. airlines should focus on improving Inflight wifi service and Online boarding in order to improve customer satisfaction ratings.

DT1c.png

Decision Tree 1c: {Age: 'young age', Class: 'Eco', Distance: 'short'}

0.9333716255025847
[[2852   84]
 [ 148  398]]
              precision    recall  f1-score   support

           0       0.95      0.97      0.96      2936
           1       0.83      0.73      0.77       546

    accuracy                           0.93      3482
   macro avg       0.89      0.85      0.87      3482
weighted avg       0.93      0.93      0.93      3482
DT_1c: [('Inflight wifi service', 0.8882870684251057), ('Departure/Arrival time convenient', 0.02017533956555176)]

Given a {young age} person with a seat in {Eco Class} going a {short distance}, the U.S. airlines should focus on improving Inflight wifi service and Departure/Arrival time convenient in order to improve customer satisfaction ratings.

Decision Tree 1d: {Age: 'young age', Class: 'Eco', Distance: 'long'}

0.9337748344370861
[[130   7]
 [  3  11]]
              precision    recall  f1-score   support

           0       0.98      0.95      0.96       137
           1       0.61      0.79      0.69        14

    accuracy                           0.93       151
   macro avg       0.79      0.87      0.83       151
weighted avg       0.94      0.93      0.94       151
DT_1d: [('Inflight wifi service', 0.6834184805619656), ('Inflight service', 0.0649684085822387)]

Given a {young age} person with a seat in {Eco Class} going a {long distance}, the U.S. airlines should focus on improving Inflight wifi service and Inflight service in order to improve customer satisfaction ratings.

DT1e.png

Decision Tree 1e: {Age: 'young age', Class: 'Eco Plus', Distance: 'short'}

0.95260663507109
[[352   8]
 [ 12  50]]
              precision    recall  f1-score   support

           0       0.97      0.98      0.97       360
           1       0.86      0.81      0.83        62

    accuracy                           0.95       422
   macro avg       0.91      0.89      0.90       422
weighted avg       0.95      0.95      0.95       422
DT_1e: [('Inflight wifi service', 0.7530948031240623), ('Seat comfort', 0.04987025759618133)]

Given a {young age} person with a seat in {Eco Plus Class} going a {short distance}, the U.S. airlines should focus on improving Inflight wifi service and Seat comfort in order to improve customer satisfaction ratings.

Decision Tree 1f: {Age: 'young age', Class: 'Eco Plus', Distance: 'long'}

0.8888888888888888
[[21  2]
 [ 1  3]]
              precision    recall  f1-score   support

           0       0.95      0.91      0.93        23
           1       0.60      0.75      0.67         4

    accuracy                           0.89        27
   macro avg       0.78      0.83      0.80        27
weighted avg       0.90      0.89      0.89        27
DT_1f: [('Inflight wifi service', 0.7952165481577246), ('Leg room service', 0.06981254040077568)]

Given a {young age} person with a seat in {Eco Plus Class} going a {long distance}, the U.S. airlines should focus on improving Inflight wifi service and Leg room service in order to improve customer satisfaction ratings.

DT2a.png

Decision Tree 2a: {Age: 'middle age', Class: 'Business', Distance: 'short'}

0.9181575942139323
[[1102   97]
 [ 118 1310]]
              precision    recall  f1-score   support

           0       0.90      0.92      0.91      1199
           1       0.93      0.92      0.92      1428

    accuracy                           0.92      2627
   macro avg       0.92      0.92      0.92      2627
weighted avg       0.92      0.92      0.92      2627
DT_2a: [('Online boarding', 0.46444958270629105), ('Inflight wifi service', 0.20549972993794932)]

Given a {middle age} person with a seat in {Business Class} going a {short distance}, the U.S. airlines should focus on improving Online Boarding and Inflight wifi service in order to improve customer satisfaction ratings.

DT2b.png

Decision Tree 2b: {Age: 'middle age', Class: 'Business', Distance: 'long'}

0.9426573426573427
[[382  37]
 [ 45 966]]
              precision    recall  f1-score   support

           0       0.89      0.91      0.90       419
           1       0.96      0.96      0.96      1011

    accuracy                           0.94      1430
   macro avg       0.93      0.93      0.93      1430
weighted avg       0.94      0.94      0.94      1430
DT_2b: [('Inflight entertainment', 0.3866873963543253), ('Inflight wifi service', 0.13974393265681762)]

Given a {middle age} person with a seat in {Business Class} going a {long distance}, the U.S. airlines should focus on improving Inflight entertainment and Inflight wifi service in order to improve customer satisfaction ratings.

DT2c.png

Decision Tree 2c: {Age: 'middle age', Class: 'Eco', Distance: 'short'}

0.9375619425173439
[[2399   56]
 [ 133  439]]
              precision    recall  f1-score   support

           0       0.95      0.98      0.96      2455
           1       0.89      0.77      0.82       572

    accuracy                           0.94      3027
   macro avg       0.92      0.87      0.89      3027
weighted avg       0.94      0.94      0.94      3027
DT_2c: [('Inflight wifi service', 0.7340998863707667), ('Seat comfort', 0.06398462532659495)]

Given a {middle age} person with a seat in {Eco Class} going a {short distance}, the U.S. airlines should focus on improving Inflight wifi service and Seat comfort in order to improve customer satisfaction ratings.

DT2d.png

Decision Tree 2d: {Age: 'middle age', Class: 'Eco', Distance: 'long'}

0.917910447761194
[[101   4]
 [  7  22]]
              precision    recall  f1-score   support

           0       0.94      0.96      0.95       105
           1       0.85      0.76      0.80        29

    accuracy                           0.92       134
   macro avg       0.89      0.86      0.87       134
weighted avg       0.92      0.92      0.92       134
DT_2d: [('Inflight wifi service', 0.6519363671473773), ('Checkin service', 0.08240555954585392)]

Given a {middle age} person with a seat in {Eco Class} going a {long distance}, the U.S. airlines should focus on improving Inflight wifi service and Checkin service in order to improve customer satisfaction ratings.

DT2e.png

Decision Tree 2e: {Age: 'middle age', Class: 'Eco Plus', Distance: 'short'}

0.9090909090909091
[[394  24]
 [ 28 126]]
              precision    recall  f1-score   support

           0       0.93      0.94      0.94       418
           1       0.84      0.82      0.83       154

    accuracy                           0.91       572
   macro avg       0.89      0.88      0.88       572
weighted avg       0.91      0.91      0.91       572
DT_2e: [('Online boarding', 0.44295331085602313), ('Inflight wifi service', 0.2962840168180451)]

Given a {middle age} person with a seat in {Eco Plus Class} going a {short distance}, the U.S. airlines should focus on improving Inflight wifi service and Online boarding in order to improve customer satisfaction ratings.

DT2f.png

Decision Tree 2f: {Age: 'middle age', Class: 'Eco Plus', Distance: 'long'}

0.7878787878787878
[[19  3]
 [ 4  7]]
              precision    recall  f1-score   support

           0       0.83      0.86      0.84        22
           1       0.70      0.64      0.67        11

    accuracy                           0.79        33
   macro avg       0.76      0.75      0.76        33
weighted avg       0.78      0.79      0.79        33
DT_2f: [('Inflight wifi service', 0.7157373954366435), ('Cleanliness', 0.06950710108604845)]

Given a {middle age} person with a seat in {Eco Plus Class} going a {long distance}, the U.S. airlines should focus on improving Inflight wifi service and Cleanliness in order to improve customer satisfaction ratings.

DT3a.png

Decision Tree 3a: {Age: 'old age', Class: 'Business', Distance: 'short'}

0.9610356318892591
[[ 957   85]
 [  67 2792]]
              precision    recall  f1-score   support

           0       0.93      0.92      0.93      1042
           1       0.97      0.98      0.97      2859

    accuracy                           0.96      3901
   macro avg       0.95      0.95      0.95      3901
weighted avg       0.96      0.96      0.96      3901
DT_3a: [('Leg room service', 0.41328662855215775), ('Online boarding', 0.15755946455060477)]

Given a {old age} person with a seat in {Business Class} going a {short distance}, the U.S. airlines should focus on improving leg room service and Online boarding in order to improve customer satisfaction ratings.

DT3b.png

Decision Tree 3b: {Age: 'old age', Class: 'Business', Distance: 'long'}

0.9715947980835045
[[ 506   22]
 [  61 2333]]
              precision    recall  f1-score   support

           0       0.89      0.96      0.92       528
           1       0.99      0.97      0.98      2394

    accuracy                           0.97      2922
   macro avg       0.94      0.97      0.95      2922
weighted avg       0.97      0.97      0.97      2922
DT_3b: [('Leg room service', 0.4546501578313305), ('Seat comfort', 0.19984166921649862)]

Given a {old age} person with a seat in {Business Class} going a {long distance}, the U.S. airlines should focus on improving Leg room service and Seat comfort in order to improve customer satisfaction ratings.

DT3c.png

Decision Tree 3c: {Age: 'old age', Class: 'Eco', Distance: 'short'}

0.9198621283929341
[[3513  166]
 [ 206  757]]
              precision    recall  f1-score   support

           0       0.94      0.95      0.95      3679
           1       0.82      0.79      0.80       963

    accuracy                           0.92      4642
   macro avg       0.88      0.87      0.88      4642
weighted avg       0.92      0.92      0.92      4642
DT_3c: [('Inflight wifi service', 0.8177816924564201), ('Inflight entertainment', 0.04628661973080516)]

Given a {old age} person with a seat in {Eco Class} going a {short distance}, the U.S. airlines should focus on improving Inflight wifi service and Inflight entertainment in order to improve customer satisfaction ratings.

DT3d.png

Decision Tree 3d: {Age: 'old age', Class: 'Eco', Distance: 'long'}

0.9082969432314411
[[178  10]
 [ 11  30]]
              precision    recall  f1-score   support

           0       0.94      0.95      0.94       188
           1       0.75      0.73      0.74        41

    accuracy                           0.91       229
   macro avg       0.85      0.84      0.84       229
weighted avg       0.91      0.91      0.91       229
DT_3d: [('Inflight wifi service', 0.6810596395421958), ('Ease of Online booking', 0.052055044636828154)]

Given a {old age} person with a seat in {Eco Class} going a {long distance}, the U.S. airlines should focus on improving Inflight wifi service and Ease of online booking in order to improve customer satisfaction ratings.

DT3e.png

Decision Tree 3e: {Age: 'old age', Class: 'Eco Plus', Distance: 'short'}

0.8762626262626263
[[543  59]
 [ 39 151]]
              precision    recall  f1-score   support

           0       0.93      0.90      0.92       602
           1       0.72      0.79      0.76       190

    accuracy                           0.88       792
   macro avg       0.83      0.85      0.84       792
weighted avg       0.88      0.88      0.88       792
DT_3e: [('Inflight wifi service', 0.7314282145145199), ('Inflight entertainment', 0.05103205175722901)]

Given a {old age} person with a seat in {Eco Plus Class} going a {short distance}, the U.S. airlines should focus on improving Inflight wifi service and Inflight entertainment in order to improve customer satisfaction ratings.

DT3f.png

Decision Tree 3f: {Age: 'old age', Class: 'Eco Plus', Distance: 'long'}

0.8157894736842105
[[27  6]
 [ 1  4]]
              precision    recall  f1-score   support

           0       0.96      0.82      0.89        33
           1       0.40      0.80      0.53         5

    accuracy                           0.82        38
   macro avg       0.68      0.81      0.71        38
weighted avg       0.89      0.82      0.84        38
DT_3f: [('Inflight wifi service', 0.6492331963299703), ('Ease of Online booking', 0.17825698021143935)]

Given a {old age} person with a seat in {Eco Plus Class} going a {long distance}, the U.S. airlines should focus on improving Inflight wifi service and Online boarding in order to improve customer satisfaction ratings.

Conclusion:

The accuracy of the models is high with an average of 92%, so the results are valid to make recommendations for airline companies. Each model gives a different recommendation statement.