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 80% training, 10% validation and 10% testing sets, with random_state =42.
Initialize a linear regression model.
Initialize a k-nearest neighbors regression model with k =3.
Define a set of 10 cross-validation folds with random_state=42.
Fit the models with cross-validation 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!