Question: HelloI want answer for my question. I have python code that I need to add train _ test _ split function plz help me (

HelloI want answer for my question. I have python code that I need to add train_test_split function plz help me (using my code in down)
import numpy as npfrom sklearn.datasets import load_diabetes diabetes_X, diabetes_y = load_diabetes (return_X_y= True)
diabetes_X[0:5]
diabetes_y[0:5]
diabetes_X.shape
diabetes_X = diabetes_X[:,np.newaxis,2]
diabetes_X.shape diabetes_X_train = diabetes_X[:-20]
diabetes_X_test = diabetes_X[-20:] diabetes_X_train.shape
diabetes_X_test.shape
diabetes_y_train = diabetes_y[:-20]diabetes_y_test = diabetes_y[-20:] diabetes_y_train.shape
diabetes_y_test.shape

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!