Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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