Logistic regression notation confusion

30 Views Asked by At

I am studying logistic regression but I am confused about why we can do this: $$P(y=1|x;\theta) = h_\theta(x)$$ $$P(y=0|x;\theta) = 1- h_\theta(x)$$

how these two become:

$$P(y|x_i\theta) = h(x)^y (1-h(x))^{1-y}$$

1

There are 1 best solutions below

0
On BEST ANSWER

This is due to $y$ is binary.

Observe this term: $$P(y|x_i\theta) = h(x)^y (1-h(x))^{1-y}$$

When $y=1$, $$P(y=1|x_i,\theta) = h(x)^1 (1-h(x))^{1-1}=h(x)(1-h(x))^0=h(x)$$

When $y=0$, $$P(y=0|x_i,\theta) = h(x)^0 (1-h(x))^{1-0}=h(x)^0(1-h(x))^1=1-h(x)$$