DEV Community

Zarin Saima Roza
Zarin Saima Roza

Posted on

Optimization of log loss

Let's think of a scene where to win you need 7 H and 3 T in 10 times of tosses. And, three are 3 different coins has different possibilities of having H and T. Which coin has the probability of winning?

Image description
Surely, number 1 wins!

Image description
Let's see how we can solve this,

Image description
This can be used using the chain rule, But then it will be lengthy. So, using the log function on g(p)(the chances of winning) is the wisest decision. Then finding the derivative of the log loss will give the correct answer.

Image description
So what is the log loss?
According to a data scientist, log-loss is indicative of how close the prediction probability is to the corresponding actual/true value (0 or 1 in the case of binary classification). The more the predicted probability diverges from the actual value, the higher the log-loss value.

The relationship of log loss with ml is shown below-

Image description
Here, we minimize the log loss and get that the optimal p is 0.7.
:D

Top comments (0)