Question: Class- Data mining Chapter - Linear Regression Using python, I suppose to find the predict the fare for the new data set Question 3 (3
Class- Data mining
Chapter - Linear Regression
Using python, I suppose to find the predict the fare for the new data set
Question 3 (3 points)Using the first model, compute the predicted fare for the following route:
COUPON = 1.202, NEW = 3, VACATION = No, SW = No, HI = 4442.141, S_INCOME = $28,760, E_INCOME = $27,664, S_POP = 4,557,004, E_POP = 3,195,503, SLOT = Free, GATE = Free, PAX = 12782, DISTANCE = 1976 miles.
This what I have done so far
new_df = pd.DataFrame(
[[1.202, 3, 0, 0, 4442.141, 28760, 27664, 4557004, 3195503, 1, 1, 1976, 12782]],
columns=['COUPON', 'NEW', 'VACATION', 'SW', 'HI', 'S_INCOME', 'E_INCOME',
'S_POP', 'E_POP', 'SLOT', 'GATE', 'DISTANCE', 'PAX'])
new_df
Hint: use the functionairfares_lm.pred()to predict the airfare for the new data by inputtingnew_dfto the prediction function.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
