修改5.LR文档

This commit is contained in:
chenyyx
2017-09-14 23:52:41 +08:00
parent 9d2ef5fdaa
commit 3ab442bfab
2 changed files with 4 additions and 0 deletions

View File

@@ -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

BIN
images/5.Logistic/LR_21.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 726 KiB