本人通过python实现梯度下降公式的代码时遇到问题如下,输入代码:<< y_hat = weight*X + bias<< loss = y_hat - y<< derivative_weight = X.T.dot(loss)/len(X)<结果输出name error:‘weight’ is not defined还求高人指点
weight是权重值,一般设置为0.05即可:weight = 0.05