You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

week3.md 1.9 kB

8 years ago
8 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. [TOC]
  2. # 6 逻辑回归(Logistic Regression)
  3. ## 6.1 分类(Classification)
  4. 在分类问题中,预测的结果是离散值(结果是否属于某一类),逻辑回归算法(Logistic Regression)被用于解决这类分类问题。
  5. - 垃圾邮件判断
  6. - 金融欺诈判断
  7. - 肿瘤诊断
  8. 肿瘤诊断问题:
  9. ![](image/20180109_144040.png)
  10. 肿瘤诊断问题是一个二元分类问题,则定义 $ y \in\lbrace 0, 1\rbrace$,其中 0 表示**负向类(negative class)**,代表恶性肿瘤,1 为**正向类(positive class)**,代表良性肿瘤。如图,定义最右边的样本为**偏差项**。
  11. 在未加入偏差项时,线性回归算法给出了品红色的拟合直线,若规定
  12. $h_\theta(x) \geqslant 0.5$ ,预测为 $y = 1$,即正向类;
  13. $h_\theta(x) \lt 0.5$ ,预测为 $y = 0$,即负向类。
  14. 即以 0.5 为分类**阈值**(threshold),则我们就可以根据线性回归结果,得到相对正确的分类结果 $y$。
  15. 接下来加入偏差项,线性回归算法给出了靛青色的拟合直线,如果阈值仍然为 0.5,对于明明属于负向类的情况,算法会给出正向类这个完全错误的结果。
  16. 不仅如此,线性回归算法的值域为 $R$,则当线性回归算法给出如 $h = 1000, h = -1000$ 等数值时,我们仍会给出结果 $y \in \lbrace 0, 1\rbrace$,这显得非常怪异。
  17. 区别于线性回归算法,逻辑回归算法是一个分类算法,**其输出值永远在 0 到 1 之间**,即 $h \in (0,1)$。
  18. ## 6.2 假设函数表示(Hypothesis Representation)
  19. ## 6.3 Decision Boundary
  20. ## 6.4 Cost Function
  21. ## 6.5 Simplified Cost Function and Gradient Descent
  22. ## 6.6 Advanced Optimization
  23. ## 6.7 Multiclass Classification_ One-vs-all
  24. # 7 Regularization
  25. ## 7.1 The Problem of Overfitting
  26. ## 7.2 Cost Function
  27. ## 7.3 Regularized Linear Regression
  28. ## 7.4 Regularized Logistic Regression

机器学习

Contributors (1)