Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def inpro(fname):
- data=np.genfromtxt(fname, delimiter=',')
- xtemp=data[:,1:] #getting the inputs
- y=data[:,0] #getting the labels
- n=len(data) #total number of training points
- d=len(data[0])-1 #dimensions
- x=np.ones((n,d+1))
- x[:,:-1]=xtemp #adding a column of ones to the outside, for the constant term
- return (x,y,d,n) #x is input, y is output, d is dimension, and n is number of points
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement