Question: d ) ( 4 0 points ) Create a class method called train _ and _ validate _ diabetes that gets one int argument called

d)(40 points) Create a class method called train_and_validate_diabetes that gets one int
argument called given_seed. This method reads the diabetes data from scikit-learn
library using datasets.load_diabetes 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 30% of the data. You have to
use method train_test_split from scikit-learn to split the data, and set
random_state=given_seed). It trains a model on train data using LinearRegression from
scikit-learn. After the model is trained, it validates the result by calling calculateRMSE
and calculateMAE (created at subpoints b) and c)). The method returns a tuple
containing (RMSEvalue, MAEvalue).
 d)(40 points) Create a class method called train_and_validate_diabetes that gets one

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!