Log likelihood function for logistic regression

1.2k Views Asked by At

If the training set S represents are an independent and identically distributed (i.i.d.) sample of a Bernoulli distribution and in logistic regression log likelihood function is given as,

$$L(y_i,f)=-\sum_{i=1}^m {{y_i} \text{log } \pi(x_i)+ (1-y_i)\text{log }(1-\pi(x_i)}$$

but in paper's log likelihood function is also written as

$$L(y_i,f)=\sum_{i=1}^n \log(1+e^{-y_if(x_i)})$$

I am confused are these two expression same or they are different. If same how to derive the second equation from first.

1

There are 1 best solutions below

1
On BEST ANSWER

$\sum_{i=1}^m {{y_i} \text{log } \pi(x_i)+ (1-y_i)\log(1-\pi(x_i)})=\sum_{i=1}^m [ y_{i}(log\pi(x_{i})-\log(1-\pi(x_i)))+\log(1-\pi(x_i))] $

Now $\dfrac{\pi(x)}{1-\pi(x)}=e^{f(x)}$ and

$log\pi(x_{i})-\log(1-\pi(x_i))=log\dfrac{\pi(x_{i})}{(1-\pi(x_i))}$

I think with this you can get it. Luck!! and if you cant ill help you later