434 views

1 Answer

0 votes
0 votes

Objective Function

The objective function for logistic regression is the log likelihood. Assuming we have $N$ samples in our dataset, and  $y_i$   is the true label for the  $i$ – th sample (either 0 or 1), and  $p(y_i \mid f1_i, f2_i, f3_i)$ is the predicted probability for the  $i$ – th sample, the log likelihood is given by:

$J(\theta) = -\sum_{i=1}^{N} \left[ y_i \log(p(y_i | f1_i, f2_i, f3_i)) + (1 - y_i) \log(1 - p(y_i | f1_i, f2_i, f3_i)) \right]$

here $\theta$ represents the parameters of the model.

Loss Function:

The negative log likelihood is commonly used as the loss function in logistic regression. It is simply the negation of the log likelihood:

$J(θ)=−L(θ)$

So, the loss function for binary classification with logistic regression becomes:

$J(\theta) = -\sum_{i=1}^{N} \left[ y_i \log\left(p(y_i \mid f1_i, f2_i, f3_i)\right) + (1 - y_i) \log\left(1 - p(y_i \mid f1_i, f2_i, f3_i)\right) \right]$

Related questions

0 votes
0 votes
1 answer
1
gateexplore asked Nov 30, 2023
255 views
Please Solve this question with full explanation.
1 votes
1 votes
0 answers
3
Aegon asked Apr 9, 2018
843 views
Recently, IITH has introduced machine learning as a choice beside general CS. As its newly introduced is it better to give it a first priority than General CS if someone...
1 votes
1 votes
0 answers
4
Venkat Sai asked Mar 29, 2018
809 views
Can anyone tell me their interview experience for machine learning and computing at IIST ?? i heard there are only 3 seats for general category ? what is the procedure fo...