2024-05-16 18:14:21 发布
网友
利用梯度法实现了岭回归公式。下面一个为指定的迭代重复执行。因为我找不到正确的实现,所以低于1是正确的吗任何地方。谢谢. 你知道吗
#ridge regression lambda = 1 #self.apha is learning rate self.theta-= (lambda * self.theta) + self.alpha/self.n_samples * self.X.T @ (predictions - self.y)
从这篇文章https://towardsdatascience.com/l1-and-l2-regularization-methods-ce25e7fc831c得到了答案。 编写的代码是正确的。你知道吗
从这篇文章https://towardsdatascience.com/l1-and-l2-regularization-methods-ce25e7fc831c得到了答案。 编写的代码是正确的。你知道吗
相关问题 更多 >
编程相关推荐