Question: 2: Even-Odd Train-Test Split Now that we have have our data, we need to split this into a set of variables we will be training

2: Even-Odd Train-Test Split Now that we have have our data, we need to split this into a set of variables we will be training on, and the set of variables that we will make our predictions on. In this case, we're splitting the values such that the training set consists of growth rates for even years and the test consists of growth rates for odd years. We also need to split our data into the predictive features (denoted X) and the response (denoted y). Write a function that will take as input a 2-d numpy array and return four variables in the form of (X_train, y_train), (X_test, y_test), where (X_train, y_train) are the features / response of the training set, and (X-test, y_test) are the feautes / response of the testing set where the training and testing data consists of even and odd years respectively: Function Specifications: Should take a 2-d numpy array as input. Should return two tuples of the form (X_train, y_train), (X_test, y_test). (X_train, y_train) should consist of data from even years and (X_test, y_test) should consist of data from odd years. def feature_response_split(arr): # your code here return

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 General Management Questions!