Generating data points

Now, we define a function called sample_points for generating our input (x,y) pairs. It takes the parameter k as input, which implies the number of (x,y) pairs we want to sample:

def sample_points(k):
x = np.random.rand(k,50)
y = np.random.choice([0, 1], size=k, p=[.5, .5]).reshape([-1,1])
return x,y
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.197.95