Answered step by step
Verified Expert Solution
Link Copied!

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 Invistico_Airline_LR.csv 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, Flight_Distance, Departure_Delay_in_Minutes,
Arrival_Delay_in_Minutes, and satisfaction.
Read the file Invistico_Airline_LR.csv into a data frame.
Re-code the categorical variables Gender, Class, and satisfaction in to dummy variables.
Create a new data frame X from the predictor variables Gender_female, Age, Class_Eco, Flight_Distance, Departure_Delay_in_Minutes,
and Arrival_Delay_in_Minutes, in that order.
Create a response variable Y from the dummy variable satisfaction_satisfied.
Perform logistic regression on x and Y.
Print the parameters of the logistic regression model.
Ex: If only the variables Gender_female, Age, Class_Eco, Flight_Distance, and Departure_Delay_in_Minutes are used as predictors, the output
is:
const -1.681250
Gender_Female 2.868598
Age 0.000368
Class_Eco 0.350065
Flight_Distance -0.000354
Departure_Delay_in_Minutes -0.009452
dtype: float64
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Server Query Performance Tuning

Authors: Sajal Dam, Grant Fritchey

4th Edition

1430267429, 9781430267423

More Books

Students also viewed these Databases questions