Question: d ) ( 4 0 points ) Create a class method called train _ and _ validate _ diabetes that gets one int argument called
d points Create a class method called trainandvalidatediabetes that gets one int
argument called givenseed. This method reads the diabetes data from scikitlearn
library using datasets.loaddiabetes method. This method reads the
data into a dataframe, and it processes the data such that it can train a model that uses
linear regression to predict the 'target' label.
It splits the data into train and test where test will have of the data. You have to
use method traintestsplit from scikitlearn to split the data, and set
randomstategivenseed It trains a model on train data using LinearRegression from
scikitlearn. After the model is trained, it validates the result by calling calculateRMSE
and calculateMAE created at subpoints and c The method returns a tuple
containing RMSEvalue MAEvalue
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
