Question
The Scikit-learn library has a number of built-in datasets. In this exercise, we will use the Diabetes dataset. First, you have to import the datasets
The Scikit-learn library has a number of built-in datasets. In this exercise, we will use the Diabetes dataset. First, you have to import the datasets module of the scikit-learn library and then you call the load_diabetes() function to load the dataset into a variable that we name as diabetes. This dataset contains physiological data of 442 patients and as corresponding target an indicator of the disease progression after a year. The physiological data occupies the first 10 columns respectively: Age Sex Body Mass Index Blood Pressure S1, S2, S3, S4, S5, S6 (six blood serum measurements) These measurements can be obtained by calling the data attribute. For example, we look at the 10 values for the first patient. As for the indicators of the progress of the disease, that is, the values that must correspond to the results of your predictions, these are obtainable by means of the target attribute
Partition the 442 patients into a training set (composed of the first 422 patients) and a test set (the last 20 patients).
Once the model is trained (lets say using sklearn), get the ten coefficients calculated for each physiological variable, using the coef_ attribute of the predictive model
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started