internalsGet Pro

Module 05 · Lesson 13 of 14Pro

Entropy and cross-entropy: measuring surprise

Level
Intermediate
Topic
Probability and statistics for machine learning
Reading time
17 min

When you finish this page you can

  1. Compute the surprise of an outcome and the entropy of a label, in nats and in bits.
  2. Explain log loss as cross-entropy, and split it into the label’s entropy plus a KL gap.
  3. Compare models on different labels by dividing each log loss by its own entropy floor.
  4. Spot loss values that point to a bug, such as a fresh classifier far above ln K.

Builds on 2 lessons

Start with lesson 917 min
  1. Maximum likelihood: fitting models to data17 min
  2. The chain rule: derivatives through layers14 min

Is a log loss of 0.330 good?

is our example online store. Farah, an ML engineer, builds its model. It gives each customer a chance of leaving next quarter, so Joseph’s growth team knows who should get a win-back voucher.

Our biggest sale ever · Black Friday

Flat 50% Off

Pro

Continue reading

Unlock every course, now and later

  • System Design, live
  • AI Engineering, live
  • Data Engineering, live
  • Machine Learning Engineering, live
  • Inference Engineering, coming soon
  • AI Research, coming soon
  • Performance Engineering, coming soon
  • Agent & Harness Engineering, coming soon
  • LLM Fine-tuning, coming soon
  • LLM Pre-training & Post-training, coming soon
  • Reinforcement Learning, coming soon
  • AI Infrastructure & Platform Engineering, coming soon
  • AI Evaluation & Safety, coming soon
  • Forward Deployed Engineering, coming soon
  • Cloud Computing, coming soon
  • DevOps, coming soon

50% off · Annual and Lifetime

BLACKFRIDAY50Applied at checkout

Choose a plan