#损失函数
def cost(X,y,theta):
left = np.multiply(y,np.log(model(X,theta)))
right = np.multiply(1 - y,np.log(1 - model(X,theta)))
return np.sum(left - right)/(len(X))
#损失函数
def cost(X,y,theta):
left = np.multiply(y,np.log(model(X,theta)))
right = np.multiply(1 - y,np.log(1 - model(X,theta)))
return np.sum(left - right)/(len(X))