Logistic Regression



Overview and implementation of Logistic Regression analysis.

$$ \large h_{\theta}(x)=g(\theta^Tx)=\frac{e^{\theta^Tx}}{1+e^{\theta^Tx}}=\frac{1}{1+e^{-\theta^Tx}} $$

where:

$$ \large \theta^Tx= \begin{bmatrix} \theta_0 \\ \theta_1 \\ \vdots \\ \theta_i \end{bmatrix} \begin{bmatrix} 1 & x_{11} & \cdots & x_{1i} \\ 1 & x_{21} & \cdots & x_{2i} \\ \vdots & \vdots & \ddots & \vdots \\ 1 & x_{n1} & \cdots & x_{ni} \end{bmatrix} $$

where:

logistic regression data

logistic regression training

To find the boundary line components:

$$ \large \theta_0+\theta_1 x_1+\theta_2 x_2=0 $$

Considering $\large x_2$ as the dependent variable:

$$ \large x_2=-\frac{\theta_0+\theta_1 x_1}{\theta_2} $$

regressão logística prediction