Question: Complete a regression analysis on the data set flight price.csv . The dataset contains information on flights for Indian airline companies. The goal is to
Complete a regression analysis on the data set flight price.csv The dataset contains information on flights for Indian airline companies. The goal is to predict flight prices, which is the last column in the data set.
Review the notes found in fullclassification.html to learn how to preprocess the data.
Apply the following steps.
Delete the two columns 'Unnamed: and 'flight'.
Split the dataset using the code
flighttrain, flighttest traintestsplitflight randomstate trainsize shuffle True
Show statistical values for numerical attributes.
Show frequency values for categorical attributes.
Preprocess the training data similarly to what was done in fullclassification.html
Train a regression model on the training data. Use the algorithm RandomForestRegressorrandomstate
Apply the same preprocessing on the test data.
Make predictions on the test data.
Output the log mean squared error: nplognpmeannpsquareypred ytest
The value I obtain is
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
