我是靠谱客的博主 俊逸寒风,这篇文章主要介绍CS229 Lecture Note(1): Linear Regression,现在分享给大家,希望可以做个参考。

1. LMS Algorithm

  • The Ordinary Least Squares Regression Model:

    h(θ)=θTx

  • Cost Function:

    J(θ)=12∑i=1m(hθ(xi)−yi)2

  • Gradient Descent Algorithm:

    θ:=θ−α∂∂θJ(θ)

  • LMS (least mean squares) update rule (also called for Widrow-Hoff learning rule):

    θj:=θj+α∑i=1m(yi−hθ(xi))xij

  • Batch Gradient Descent vs. Stochastic Gradient Descent

    
    # BGD
    
    Repeat until convergence {
        theta = theta + alpha * sum((y_i - h_i) * x_i)
    }
    
    
    # SGD
    
    Loop {
        for i=1 to m, {
            theta = theta + alpha * (y_i - h_i) * x_i
        }
    }
  • Normal Equation Solution:

    θ=(XTX)−1XTY

2. Probabilistic Interpretation

  • Predictive Probability Assumption: a Gaussian Distribution

    p(y|x;θ)=12π‾‾‾√σe−(y−θTx)22σ2∼(θTx,σ2)

  • Likelihood Function of θ : the probability of the given data y (given i.i.d. assumption)

    L(θ)=∏i=1mp(yi|xi;θ)=∏i=1m12π‾‾‾√σe−(yi−θTxi)22σ2

  • Maximum Likelihood Method: choose θ to maximize L(θ) or the log likelihood l(θ) :

    l(θ)=logL(θ)⇒12∑i=1m(yi−θTxi)2
    θ=argmaxθl(θ)

The least-squares regression model corresponds to the maximum likelihood estimation of θ under a Gaussian distribution assumption on data.

3. Locally Weighted Linear Regression

  • Motivation: get rid of the problem of feature selection (which leads to the underfitting and overfitting problems)

  • Parametric vs. Non-parametric learning algorithm

  • LWR algorithm:
    Querying a certain point x ,

    1. Fit θ to minimize ∑iwi(yi−θTxi)2 , where wi=e−(xi−x)22τ2

    2. Output θTx
    3. Hence, the (errors on) training examples close to the query point x would be given a much higher weight to determine θ (local linearity).

最后

以上就是俊逸寒风最近收集整理的关于CS229 Lecture Note(1): Linear Regression的全部内容,更多相关CS229内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(242)

评论列表共有 0 条评论

立即
投稿
返回
顶部