Question: Exercise 2 : Let's create a training and a test set. Drop the target column from the ridge _ data DataFrame and store the remaining

Exercise 2: Let's create a training and a test set.
Drop the target column from the ridge_data DataFrame and store the remaining features in a DataFrame named X (uppercase X).
Save the target column as a Series named y (lowercase y).
Utilize Scikit-learn's train_test_split function, using X and yto create a training set and a test set. Allocate 80% of the instances for training and 20% for testing. Set the random_state to 42 to ensure reproducibility of our results. Assign the DataFrames the following names: X_train, X_test, y_train, and y_test.

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 Programming Questions!