liveBook · Manning

Natural logarithm

As explained in Grokking Machine Learning, Second Edition

The logarithm to the base of Euler's number, used to measure exponential growth and define log-based losses.

A natural logarithm appears inside log loss, an error function for continuous perceptrons. Its role is to turn probability quality into a useful loss value. section 6.4

Log loss uses the probability assigned to the correct label: high probabilities produce small losses, while low probabilities produce large losses. section 6.4

A small numerical comparison

If the correct-label probability is 0.731, the loss is −ln(0.731) = 0.313. If it is 0.119, the loss is −ln(0.119) = 2.127.

How Grokking Machine Learning, Second Edition covers it

How deep it goes
Defines the logarithm’s role through probability examples and calculated losses, without developing logarithm theory or derivatives.
Examples
Calculates −ln(0.047), −ln(0.731), −ln(0.119), and −ln(0.881) for four happy and sad points.
What it assumes
Assumes familiarity with predictions between zero and one, labels, and probabilities; builds the probability-to-loss connection through examples.
What you can do after
Evaluate how confidently a continuous perceptron assigns the correct label by interpreting natural-log loss values.
How it connects
Connects natural logarithms to log loss, probability, continuous perceptrons, and logistic classifiers.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Machine Learning, Second Edition. The section links point to the parts of the book it draws on.