Cross-entropy H(p,q) = -Σ p(x) log q(x) measures how well q approximates p

Ever wondered how well we can guess the outcome of a random event?

Image: David Condrey, CC BY-SA 3.0, via Wikimedia Commons

Cross-entropy H(p,q) = -Σ p(x) log q(x) measures how well q approximates p

Ever wondered how well we can guess the outcome of a random event?

Imagine you're trying to guess the color of a marble drawn from a bag. If you knew the bag had 50% red and 50% blue marbles, you'd expect to guess correctly 50% of the time. But what if you guessed based on your own guessings, like thinking red is more likely because you've drawn more red marbles so far?

The cross-entropy concept helps us understand how well our guesses (q) match the actual probabilities (p) of drawing a marble. It's like measuring how surprised we are when our guesses don't match reality.

Example

If you guessed red 70% of the time but red was only 50% likely, you'd be surprised 70% of the time when you guess red.

Remember this

Cross-entropy quantifies the surprise or mismatch between our estimated probabilities and the actual probabilities.

Related concepts

Swipe through 100 ML concepts daily

Open Pocket Polymath