Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please answer the question in python according to the template so the format matches exactly please. The file Invistico _ Airline _ LR . csv
Please answer the question in python according to the template so the format matches exactly please.
The file InvisticoAirlineLRcsv contains information from an airline using the alias Invistico Airline on customer satisfaction, as well as
details on each customer. The columns of interest are Gender, Age, Class, FlightDistance, DepartureDelayinMinutes,
ArrivalDelayinMinutes, and satisfaction.
Read the file InvisticoAirlineLRcsv into a data frame.
Recode the categorical variables Gender, Class, and satisfaction in to dummy variables.
Create a new data frame X from the predictor variables Genderfemale, Age, ClassEco, FlightDistance, DepartureDelayinMinutes,
and ArrivalDelayinMinutes, in that order.
Create a response variable from the dummy variable satisfactionsatisfied.
Perform logistic regression on and
Print the parameters of the logistic regression model.
Ex: If only the variables Genderfemale, Age, ClassEco, FlightDistance, and DepartureDelayinMinutes are used as predictors, the output
is:
const
GenderFemale
Age
ClassEco
FlightDistance
DepartureDelayinMinutes
dtype: float
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started