Learn Before
Concept

Logistic Regression Formulation

Given X, we want y^=P(y=1X)\hat{y}=P(y = 1|X) $0 \leq \hat{y} \leq 1$

Parameters: wRnx,bRw \in R^{n_{x}}, b \in R

Output (Activation): y^(i)=a(i)=σ(wTx(i)+b)\hat{y}^{(i)} = a^{(i)} = \sigma (w^{T}x^{(i)} + b)

Given [(x(1),y(1)),(x(2),y(2)),...,(x(m),y(m))][(x^{(1)}, y^{(1)}), (x^{(2)}, y^{(2)}), ..., (x^{(m)}, y^{(m)})], we want y^iyi\hat{y}^{i} \approx y^{i}

σ(z(i))=11+ez(i)\sigma(z^{(i)}) = \frac{1}{1 + e^{-z^{(i)}}}

If z is large positive, σ(z(i))11+0=1\sigma(z^{(i)}) \approx \frac{1}{1 + 0} = 1

If z is large negative, σ(z(i))11+BigNum0\sigma(z^{(i)}) \approx \frac{1}{1 + Big Num} \approx 0

Image 0

0

1

Updated 2024-04-05

Tags

Data Science