Question: Python Questions: 1. Load the relevant libraries. 2. From sklearn load the diabetes dataset. Display the feature names and the shape of the data. 3.
Python Questions:
1. Load the relevant libraries.
2. From sklearn load the diabetes dataset. Display the feature names and the shape of the data.
3. Split the data into training and testing. Use default parameters and specify a random state.
4. Fit a kNN regression model with 20 neighbors. Print the R-square value.
5. Fit a linear regression model. Print the coefficients and the intercept values. Print the training and test scores.
6. Fit a ridge regression model with alpha values: =1. Print the training and test scores.
7. Fit a ridge regression model with alpha values: =10. Print the training and test scores.
8. Fit a ridge regression model with alpha values: =0.1. Print the training and test scores.
9. Fit a Lasso regression model. Print the training and test scores. Find a way to improve the model performance.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
