Question: Question 3 Programming supervised learning In this question, you use an OpenML dataset of diabetes with ID 4 2 3 6 3 , https: /
Question Programming supervised learning
In this question, you use an OpenML dataset of diabetes with ID https:wwwopenml.orgsearchtypedata&statusactive&id The dataset can be loaded using the following code:
from sklearn.datasets import fetchopenml dataset fetchopenmldataid
a Write code to load and explore the dataset by printing its feature datas shape, targets shape, feature names, target names, and textual description.
b Write code to create a pandas DataFrame from the dataset, and display the DataFrame and the DataFrames descriptive statistics. Hint: use the display function for better formatted output.
c Write code to train a linear regression model for the dataset. Use only the last features in the dataset, ietempRHwind and rain Split the dataset into a training set and a test set, and do not use crossvalidation. Display the test score of the model.
d Write code to train a linear regression model for the dataset using fold cross validation. Use only the last features in the dataset, ietempRHwind and rain Use negmeanabsoluteerror for scoring in CV Display the mean score.
e Write code to train a SVR model for the dataset using fold crossvalidation. Use only the last features in the dataset, ietempRHwind and rain Use negmeanabsoluteerror for scoring in CV Display the mean score.
f State the scores of the models in parts d and e and comment on which of the two models performs better.
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
