因为随机梯度下降,批梯度下降和牛顿法都可以用在线性回归中,所以想比较一下三者的效果。
原理:
SGD,BGD:https://blog.csdn.net/cyr429/article/details/102300105
牛顿法:https://blog.csdn.net/cyr429/article/details/102624860
先放出来原数据的散点图:
需要原数据的:https://github.com/cyr429/Machine-Learning-master/tree/master/ML-others/LogisticRegression01
然后是BGD的拟合情况,用了1184个iteration达到1e-6: