Question: please solve this function using python and only numpy package is allowed def getsplittingPoints(data): IF IT IT (5 pts) function that returns a 1-D numpy

please solve this function using python and only numpy package is allowed
def getsplittingPoints(data): IF IT IT (5 pts) function that returns a 1-D numpy array with all the locations of potential splitting points for a continuous feature (just like what decision trees do when they have a continuous value). Assume the data is labeled with binary Labels [either 1, or -1] hint #1: make sure the data is ordered correctly before deciding where to split hint #2: the number of splits returned will be the midpoint where the data shifts from positive to negative, or from negative to positive. hint #3: depending on your implementation, the function np.argsort may be useful Parameters: data: 2-D numpy array with two columns as follows: The first column contains continuous feature values from 0 to 1 The second column contains Labels that are binary (either -1, or 1) e.g. [ [0.24, 1], [0.9, 1], [0.58, -1], [0.19, 1], [0.54, -1] ] IT IT IT return None
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
