Skip to content

Commit 3ab442b

Browse files
committed
修改5.LR文档
1 parent 9d2ef5f commit 3ab442b

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

docs/5.Logistic回归.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ def gradAscent(dataMatIn, classLabels):
245245
return array(weights)
246246
```
247247

248+
大家看到这儿可能会有一些疑惑,就是,我们在迭代中更新我们的回归系数,后边的部分是怎么计算出来的?为什么会是 alpha * dataMatrix.transpose() * error ?因为这就是我们所求的梯度,也就是对 f(w) 对 w 求一阶导数。具体推导如下:
249+
250+
![f(w)对w求一阶导数](../images/5.Logistic/LR_21.png)
251+
248252
> 测试算法: 使用 Logistic 回归进行分类
249253
250254
```python

images/5.Logistic/LR_21.png

726 KB
Loading

0 commit comments

Comments
 (0)