Cost function - Log Loss query
What is the purpose of using log in the logistic regression cost function log loss?
Topic cost-function loss-function logistic-regression
Category Data Science
What is the purpose of using log in the logistic regression cost function log loss?
Topic cost-function loss-function logistic-regression
Category Data Science
Let's explore the use case for binary classification. In binary classification the labels are drawn from Bernoulli distribution. For each example the likelihood of the Bernoulli distribution is
$p^y*(1-p)^{(1-y)}$.
We want to maximize the likelihood of the entire dataset, which means we want to maximize the product of all the examples.
Because we want it to be convenient for the optimizer we do two things:
Log loss is the negative log likelihood. Taking the log of a single example we get:
$y_i \log(p_i) + (1-y_i) \log (1-p_i)$.
The log loss is just the negative sum of all the examples.
Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.