【04】standford L04

来源:互联网 发布:咫尺网络官网电脑端 编辑:程序博客网 时间:2024/05/22 16:23

L4 其他解法-牛顿方法-指数家族-GLM

1、Logistic Regression——Newton’s method

2、指数家族Exponential Family

3、广义线性模型 Generalized Linear Models


1Logistic Regression——Newton’s method

进一步了解Newton’s Method

P(y|x;θ)

  • y是实数时;用高斯分布——LMS(线性回归)
  • y={0,1}二元分类,(0-1)分布,用Logistic Regression!那为什么要使用sigmoid函数呢??
    来看下面的【Generalized Linear Models (GLMs)】【Exponential Family】

2 【prepare】指数家族Exponential Family

Form

参数

η —— the natural parameter (thecanonical parameter);
T(y) —— the sufficient statistic(对于这里的分布,一般T(y)=y);
a(η) —— the log partition function(The quantity e^a(η) essentially plays the role of a nor-malization constant, that makes sure the distribution p(y;η) sums/integrates over y to 1)

0-1分布与高斯分布、

0-1分布(Bernoulli Distribution)

  • p(y= 1;φ) =φ;
  • p(y= 0;φ) = 1−φ.
  • As we varying φ, we obtain Bernoulli distributions with different means.(不同的φ,会使得分布的均值不一样,因为0-1分布的均值就是mean = φ)
    【0-1分布(Bernoulli Distribution)】化为指数家族的形式:

    高斯分布

其他分布

还有其他分布也属于指数家族(exponential family),如下:

  • The multinomial 多项式分布(which we’ll see later)
  • the Poisson 泊松分布(for modelling count-data; also see the problem set);
  • the gamma and the exponential (for modelling continuous, non-negative random variables, such as time-intervals);
  • the beta and the Dirichlet (for distributions over probabilities)

所以还要探讨更一般的形式(GLM),来构建模型,在模型中 y 来自于不同的这些不同分布。


3 Constructing GLMs

用更一般的方法GLM来解决我们在实际中遇到的问题!NICE

3.1 前提假设

1、总体服从的分布隶属于指数家族分布

2、Hypothesis h(θ)为分布的均值

3、自然参数η和输入变量x是线性相关的

3.2 Ordinary Least Squares 最小二乘法

高斯分布-属于指数家族

对于上面的why,因为在之前的讲解中提到,误差的分布大多服从正态分布,所以这里用的是高斯分布。

3.3 Logistic Regression 逻辑回归

0-1分布(伯努利分布)属于指数家族,均值也容易知道,那么推导也很简单

3.4 Softmax Regression

多分类问题,用多项式分布

【定义】





【推演】

【参数 fitting】


总结

1、新的计算参数θ的方法-Newton’s method

2、线性回归、逻辑回归的Hypothesis是怎么来的

- 指数家族

- 一般线性模型(GLM)


致谢

谢谢Andrew老师精彩的视频与讲义。

Jeremy Zhang
2014.12.31

0 0