机器学习-白板推导 P4_4 (逻辑回归)

机器学习-白板推导 P4_4

  • 逻辑回归
    • 公式
    • 方法

逻辑回归

公式

S i g m o i d f u n c t i o n Sigmoid function Sigmoidfunction

σ = 1 1 + e − z \sigma=\frac{1}{1+e^{-z}} σ=1+ez1

z → + ∞ , lim ⁡ σ ( z ) = 1 z \rightarrow +\infty,\lim \sigma(z)=1 z+limσ(z)=1
z → 0 , lim ⁡ σ ( z ) = 0.5 z \rightarrow 0,\lim \sigma(z)=0.5 z0limσ(z)=0.5
z → − ∞ , lim ⁡ σ ( z ) = 0 z \rightarrow -\infty,\lim \sigma(z)=0 zlimσ(z)=0

机器学习-白板推导 P4_4 (逻辑回归)_第1张图片
p 1 = p ( y = 1 ∣ x ) = σ ( w T x ) = 1 1 + e − w T x , y = 1 p_1=p(y=1|x)=\sigma(w^Tx)=\frac{1}{1+e^{-w^Tx}},y=1 p1=p(y=1x)=σ(wTx)=1+ewTx1,y=1

p 0 = p ( y = 0 ∣ x ) = 1 − p ( y = 1 ∣ x ) = e − w T x 1 + e − w T x , y = 0 p_0=p(y=0|x)=1-p(y=1|x)=\frac{e^{-w^Tx}}{1+e^{-w^Tx}},y=0 p0=p(y=0x)=1p(y=1x)=1+ewTxewTx,y=0

p ( y ∣ x ) = p 1 y p 0 1 − y p(y|x)=p_1^yp_0^{1-y} p(yx)=p1yp01y

方法

MLE:
w ^ = a r g max ⁡ w log ⁡ p ( Y ∣ X ) = a r g max ⁡ w log ⁡ ∏ i = 1 N p ( y i , x i ) = a r g max ⁡ w ∑ i = 1 N log ⁡ p ( y i , x i ) = a r g max ⁡ w ∑ i = 1 N ( y i log ⁡ 1 1 + e − w T x + ( 1 − y i ) l o g ( 1 − 1 1 + e − w T x ) ) \begin{aligned} \hat{w} &=arg \max_w \log p(Y|X) \\ & = arg \max_w \log \prod_{i=1}^N p(y_i,x_i) \\ & = arg \max_w \sum_{i=1}^N \log p(y_i,x_i) \\ & =arg \max_w \sum_{i=1}^N (y_i \log\frac{1}{1+e^{-w^Tx}} +(1-y_i)log(1-\frac{1}{1+e^{-w^Tx}})) \end{aligned} w^=argwmaxlogp(YX)=argwmaxlogi=1Np(yi,xi)=argwmaxi=1Nlogp(yi,xi)=argwmaxi=1N(yilog1+ewTx1+(1yi)log(11+ewTx1))
M L E ( m a x ) → l o s s f u n c t i o n ( m i n C r o s s E n t r o y ) MLE(max) \rightarrow loss function(min Cross Entroy) MLE(max)lossfunction(minCrossEntroy)

你可能感兴趣的:(#,机器学习白板推导)