Question: Create dataframe X with the feature distance. Create dataframe y with the feature fare. Split the data into 8 0 % training, 1 0 %
Create dataframe X with the feature distance.
Create dataframe y with the feature fare.
Split the data into training, validation and testing sets, with randomstate
Initialize a linear regression model.
Initialize a knearest neighbors regression model with k
Define a set of crossvalidation folds with randomstate
Fit the models with crossvalidation to the training data, using the default performance metric.
For each model, print the test score for each fold, as well as the mean and standard deviation for the model.
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
