Homework 3

There are 20 points in this assignment. The minimum increment is 0.5 point. Solve them and fill the answers in the blank space.

 

  1. 1. Continue question 2 of homework assignment 2.csv contains the data withthe selected predictors (no missing values but the predictors have not been standardized or coded). Allocate 20% of the data to the test partition. Choose VACATION_No, SW_No, SLOT_Free, GATE_Constrained as the redundant dummies to drop.
  2. Use the remaining 80% of the data as the training partition to build two LASSO regression models with the following pre-specified penalty levels respectively: alpha=0.01 and alpha=0.1. Organize the estimated coefficients and the intercept of both models into the following tables respectively. (2 points)
Pre-specified penalty level: alpha=0.01
Predictor Estimated coefficient Predictor Estimated coefficient
VACATION_Yes 0.009 E_POP 0.015
SW_Yes 0.01 SLOT_Controlled 0.1
S_INCOME 0.24 GATE_Free 0.1
E_INCOME 0.15 DISTANCE 0.9
S_POP 0.007 Intercept -163.11

 

Pre-specified penalty level: alpha=0.1
Predictor Estimated coefficient Predictor Estimated coefficient
VACATION_Yes 0.009 E_POP 0.02
SW_Yes 0.01 SLOT_Controlled 0.1
S_INCOME 0.25 GATE_Free 0.1
E_INCOME 0.15 DISTANCE 0.95
S_POP 0.007 Intercept -163.10

 

  1. Do you see any zero estimated coefficient in either of the models in (a)? For each model, if you do not, please explain why there is no zero estimated coefficient. If you do, please explain why those estimated coefficients are zero. (2 points)
Model Yes/No Why
Model with alpha=0.01 No The estimate coefficient must be more than 0.1
Model with alpha=0.1 No The estimate coefficient must be more than 0.1

 

  1. Conduct the necessary analysis to rank the predictors based on their importance. If one predictor is the n-th most important one, write number nin its column Rank of Importance. (1 point)
Predictor Rank of importance Predictor Rank of importance
VACATION_Yes 1 E_POP 4
SW_Yes 2 SLOT_Controlled 1
S_INCOME 4 GATE_Free 3
E_INCOME 5 DISTANCE 2
S_POP 3  

 

  1. Find the numerical predictors among all the predictors and rank them based on how strongly they are correlated with the dependent variable (note that the correlation can be either positive or negative). For example, 1means the most strongly correlated and 2 means the second most strongly correlated. Compare the ranking based on the importance in (c) and the ranking based on the degree of correlation in (d). Are two rankings consistent with each other within the numerical predictors? (2 points)
Numerical predictor Rank of correlation Numerical predictor Rank of correlation
S_INCOME 4    
E_INCOME 2    
S_POP 5    
E_POP 3    
DISTANCE 1    

 

  1. Use cross-validation to select the model based on predictive performance. Set the number of folds for cross-validation to 3. Organize the estimated coefficients and the intercept as well as the corresponding penalty level alpha of the final selected model in the following table. (2 points)
Predictor Estimated coefficient Predictor Estimated coefficient
VACATION_Yes 0.12 E_POP 0.22
SW_Yes 0.14 SLOT_Controlled 0.19
S_INCOME 0.13 GATE_Free 0.18
E_INCOME 0.22 DISTANCE 0.17
S_POP 0.12 Intercept 0.28
Penalty level alpha: 0.05

 

  1. How is the penalty level of the final selected model in (e) determined? (1 point)
  2. Fill the answers in the following table. Among all three models, which one has the lowest ASE over the test partition? Why does that model have the lowest ASE over the test partition? (2 points)
Model ASE over the test partition
Model in (e) 0.22
Model with alpha=0.01 in (a) 0.22
Model with alpha=0.1 in (a) 0.01

 

  1. Use the final selected model in (e) to predict the average fare on a route with the following characteristics. The prediction outcome should be in its unstandardized value. Show the calculation and explain your answer. (4 points)

VACATION = No, SW = No, S_INCOME = $28,760, E_INCOME = $27,664, S_POP = 4,557,004, E_POP = 3,195,503, SLOT = Free, GATE = Free, DISTANCE = 1976 miles.

  1. Southwest Airline announces that it will serve the same route. Based on the final selected model in (e), do you expect the average ticket fare of the major airline for that route (not counting Southwest) to increase or decrease? How much do you expect the average fare to increase or decrease? Show your calculations. (2 points)
  2. Now we change our way to code the categorical variables by choosing a different redundant dummy to drop. Specifically, instead of dropping SLOT_Free, we drop SLOT_Controlled.  Fill the answers in the following table. (2 points)
Questions Yes/No
Will it affect the estimated coefficients or the intercept of the final selected model? Yes
Will it change the penalty level of the final selected model? No
Will it affect the average squared error over the test partition? Yes
Will it affect the predicted value for the route in (h)? Yes

 

Submit your Python code with the filename [DM2022] HW3_YOURFULLNAME.ipynb


    Customer Area

    Make your order right away

    Confidentiality and privacy guaranteed

    satisfaction guaranteed