Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In python numpy package is only allowed def getsplittingPoints(data): IF IT IT (5 pts) function that returns a 1-D numpy array with all the locations

image text in transcribed

In python

numpy package is only allowed

image text in transcribed
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 AutoSave Off split_data File Home Insert Data Page Layout Formulas Review X >T Calibri 11 A A A ASE As Paste BIU Clipboard Font Alignm A1 0.239999999999999 B D E F G 1.00E+00 1.00E+00 2.40E-01 2 9.00E-01 3 2.10E-01 4 2.20E-01 5 2.80E-01 6 8.60E-01 7 5.70E-01 8 4.30E-01 6.20E-01 10 8.80E-01 11 5.80E-01 12 3.80E-01 13 2.80E-01 14 4.20E-01 15 3.90E-01 16 5.40E-01 17 3.20E-01 18 1.90E-01 19 2.90E-01 20 5.40E-01 21 22 23 24 25 1.00E+00 1.00E+00 1.00E+00 1.00E+00 -1.00E+00 -1.00E+00 -1.00E+00 1.00E+00 -1.00E+00 -1.00E+00 1.00E+00 -1.00E+00 -1.00E+00 -1.00E+00 -1.00E+00 1.00E+00 1.00E+00 -1.00E+00

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals Design

Authors: Marion Donnie Dutton Don F. Seaman

14th Edition Globel Edition

1292107634, 978-1292107639

More Books

Students also viewed these Databases questions