def costFuncReg(theta, X,y, lambda_): m = y.size J = 0 grad = np.zeros(theta.shape) h = sigmoid(X.dot(theta.T)) temp = theta temp[0] = 0 J = (1/m)*np.sum(-y.dot(np