学习笔记 | Coursera

Overview

Logistic Regression

  • Classification and Representation
    • Classification
    • Hypothesis Representation
    • Decision Boundary
  • Logistic Regression Model
    • Cost Function
    • Simplified Cost Function and Gradient Descent
    • Advanced Optimization
  • Multiclass Classification
    • Multiclass Classification: One-vs-all
  • Review

Log

  • 9/20: watched videos in 3.1

  • 9/21: watched videos in 3.2, 3.3

  • 第一次quiz没通过,3.2需要复习;

  • 9/23: 过了一遍3.4视频,但没太听进去,需要重听;

  • 2/15/2017: programming assignment done;

Reading

Note

3.1 Classification and Representation

  • Logistic Regression is actually a classification algorithm.

  • sigmoid function or logistic function

  • Interpretation of Hypothesis Output

    • h(x) = estimated probability that y = 1 on input x

    • h(x) = p(y|x; theta), probability that y = 1 given x, parameterized by theta

  • Decision Boundaries

  • Linear Decision Boundaries

  • Non-linear Decision Boundaries

3.2 Logistic Regression Model

  • Logistic regression cost function

  • simplified cost function

  • Gradient Descent

    • Optimization algorithm

    • Gradient descent

    • Conjugate gradient

    • BFGS

    • L-BFGS

      • Ad: no need to manually pick alpha; often faster than gradient descent

      • Disad: more complex

3.3 Multiclass Classification

  • one-vs-all (one-vs-rest)

3.4 Solving the Problem of Overfitting (新版这部分已删除?)

  • The problem of Overfitting – 过度拟合(Overfitting)

    • 例子:对一组适合二次多项式拟合的数据
      • 用一次多项式拟合,会造成underfit,high bias
      • 用四次多项式拟合,会造成overfit,high variance
    • 过度拟合的后果:可以很好地拟合现有数据(效用函数接近零),但缺乏新数据的预测能力
    • 如何防止
      • 减少feature:手动选择/依赖算法
      • 正则化
  • Cost function – 效用/代价函数

      • 线性回归的效用函数

        • 应用到hθ(x)效用函数非凸,会有很多局部极小存在,梯度下降不一定能得到全局最优

      • 逻辑回归的效用函数

      • 选用以上效用函数后,梯度下降法具体操作同前

      • 另外还有共轭梯度conjugate gradient、BFGS、L-BFGS:不需指定步长,更快,但更复杂

  • Regularization – 正则化

    • 在效用函数上添加对feature的惩罚项(平方和项)来达到减小feature值的目的

    • 若不知道需要减小哪些feature项就所有项都加一个平方和(除去常数系数项之外)

    • 若惩罚过重,拟合函数会变一条常数直线,underfitting

    • 正规化可以用于梯度下降方法和逻辑回归方法,修改效用函数后,其他步骤同前

  • Regularized Linear Regression – 正则化线性回归

  • Regularized Logistic Regression – 正则化逻辑回归

原文地址:https://www.cnblogs.com/casperwin/p/6386736.html