diff --git a/docs/5.Logistic回归.md b/docs/5.Logistic回归.md index 703e1e68..c60fa829 100644 --- a/docs/5.Logistic回归.md +++ b/docs/5.Logistic回归.md @@ -245,6 +245,10 @@ def gradAscent(dataMatIn, classLabels): return array(weights) ``` +大家看到这儿可能会有一些疑惑,就是,我们在迭代中更新我们的回归系数,后边的部分是怎么计算出来的?为什么会是 alpha * dataMatrix.transpose() * error ?因为这就是我们所求的梯度,也就是对 f(w) 对 w 求一阶导数。具体推导如下: + +![f(w)对w求一阶导数](../images/5.Logistic/LR_21.png) + > 测试算法: 使用 Logistic 回归进行分类 ```python diff --git a/images/5.Logistic/LR_21.png b/images/5.Logistic/LR_21.png new file mode 100644 index 00000000..94e410fa Binary files /dev/null and b/images/5.Logistic/LR_21.png differ