【发布时间】:2020-07-25 16:48:59
【问题描述】:
我在做什么?
尝试实现逻辑回归算法将特征分类为 PASS 或 FAIL。
代码:
def fit(self, theta, x, y):
opt_weights = fmin_tnc(func = cost_function, x0 = theta, fprime = gradient, args = (x, y.flatten()))
return opt_weights
parameters = fit(X, y, theta)
错误:
TypeError Traceback(最近调用 最后)在 ----> 1 个参数 = fit(X, y, theta)
TypeError: fit() 缺少 1 个必需的位置参数:'y'
这里有什么错误?
【问题讨论】:
标签: python regression typeerror