week 3 (reading notes)

0. 版權聲明

  • machine learning 系列筆記來源於Andrew Ng 教授在 Coursera 網站上所授課程《machine learning》1,該系列筆記不以盈利爲目的,僅用於個人學習、課後複習及交流討論;
  • 如有侵權,請與本人聯繫([email protected]),經覈實後即刻刪除;
  • 轉載請註明出處;

1. linear regression & logistic regression

  • 在 classification 問題中,linear regression 的 hypothesis function 會由於 training example 不同而發生較大變化,因此不宜使用線性迴歸方法處理分類問題;
    大多數實際問題並不嚴格遵從於某個 linear function ;
    defect of linear regression
  • linear regression 在預測 binary classification problem 時,即使 training example 中均滿足 0<y<10<y<1,仍可能出現 hθ(x)<0h_{\theta}(x) < 0hθ(x)>1h_{\theta}(x) > 1 的情況;
  • logistic regression 中可確保 0hθ(x)10\leq h_{\theta}(x) \leq1
    logistic regression 是一種分類算法,由於歷史原因被命名爲 regression ;

2. hypothesis representation

2.1 notation

  • hypothesis function of logistic regression 含義:當輸入爲 x 時,y = 1 的可能性;
    hθ(x)=p(y=1x;θ)h_{\theta}(x)=p(y=1|x; \theta) :probability that y = 1 ,given x, parameterized by θ\theta ;
  • decision boundary:決策邊界;

2.2 elements

  • linear regression : hθ(x)=θTxh_{\theta}(x)=\theta^{T}x ;
  • sigmoid (adj. S型的) function / logistic function : g(z)=11+ezg(z)=\frac{1}{1+e^{-z}} ; 2
  • sigmoid function 將任意值映射到 0-1 區間上;

logistics function

  • z=θTxz = \theta^{T}x
    hypothesis function of logistic regression : hθ(x)=11+eθTxh_{\theta}(x)=\frac{1}{1+e^{-\theta^{T}x}} ;
    θTx0\theta^{T}x \geq 0 時,預測 y = 1 ;
    θTx<0\theta^{T}x < 0 時,預測 y = 0 ;
  • 決策邊界不是 training set 的屬性,而是假設本身及其參數的屬性;

n. reference


  1. https://www.coursera.org/learn/machine-learning/home/welcome ↩︎

  2. https://zh.wikipedia.org/wiki/S函數 ↩︎

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章