Question: Now that we have have our data, we need to split this into a training set, and a testing set. But before we split our
Now that we have have our data, we need to split this into a training set, and a testing set. But before we split our data into training and testing, we also need to split our data into the predictive features denoted and the response denoted
Write a function that will take as input a d numpy array and retum four variables in the form of Xtrain, ytrainXtest, test where Xtrain, ytrain are the features response of the training set, and test, test are the features response of the testing set.
Function Specifications:
Should take a d numpy as input.
Should split the array such that is the year, and is the corresponding population.
Should return two tuples of the form Xtrain, rainXtest, test
Should use sklearn's traintestsplit function with a testsize and randomstate
### START FUNCTION
def featureresponsesplitarr:
# your code here
return
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
