Question: PLEASE USE PYTHON Below is part of a function that produces a test/train split on a dataset D Fill in the missing parts of the
PLEASE USE PYTHON

Below is part of a function that produces a test/train split on a dataset D Fill in the missing parts of the function in the following way using array slicing. X_train should be the first "cutoff" many elements in the shuffled matrix X2 X_test should be the remaining elements in X2 y train should be the first "cutoff many elements in the shuffled matrix y2 y_test should be the remaining elements in y2 def test_train_split(X,y,train percent-0.8,rand_seed-42): np.random.seed (rand_seed) cutoff = int ( train-percent*X.shape [0]) shuff np.random. permutation (X.shape[0]) X2Xshuff] return X_train,x_test,y_train,y_test
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
