逻辑回归实战:损失函数模块程序填空解析
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(y)
原文地址: https://www.cveoy.top/t/topic/mBR9 著作权归作者所有。请勿转载和采集!
安全问答是一个知识全球问答,包含丰富的问答知识
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(y)
原文地址: https://www.cveoy.top/t/topic/mBR9 著作权归作者所有。请勿转载和采集!