$$J(\theta)=\frac{1}{m}\sum_{i=1}^m(cost(h_\theta(x^{(i)}),y^{(i)}))$$
$$Cost(h_\theta(x),y)=\begin{cases}-log(h_\theta(x)) & \text{if y = 1}\\ -log(1 - h_\theta(x)) & \text{if y = 0}\end{cases}$$
Note y = 0 or y = 1 always
$$Cost(h_\theta(x),y)=-y*log(h_\theta(x))-(1-y)*log(1-h_\theta(x))$$
$$J(\theta)=-\frac{1}{m}\sum_{i=1}^{m}{y^{(i)}log(h_\theta(x^{(i)}))+(1-y^{(i)})*log(1-h_\theta(x^{(i)}))}$$
$$\text{To fit parameter }\theta: min J(\theta)$$
$$\text{Repeat }\{\theta_j := \theta_j-\alpha\frac{\sigma}{\sigma\theta_j}J(\theta)\}$$
$$\text{Repeat }\{\theta_j := \theta_j-\alpha\sum_{i=1}^{m}(h_\theta(x^{(i)})- y^{(i)})* x_j^{(i)}\}$$
| Hours | Pass |
| .5 | 0 |
| 0.75 | 0 |
| 1 | 0 |
| 1.25 | 0 |
| 1.5 | 0 |
| 1.75 | 0 |
| 1.75 | 1 |
| 2 | 0 |
| 2.25 | 1 |
| 2.5 | 0 |
| 2.75 | 1 |
| 3 | 0 |
| 3.25 | 1 |
| 3.5 | 0 |
| 4 | 1 |
| 4.25 | 1 |
| 4.5 | 1 |
| 4.75 | 1 |
| 5 | 1 |
| 5.5 | 1 |