Maths 1.2Lesson outlineLesson 2 of 3 in Module 1
Exponents and Logarithms
Know why logs appear everywhere in ML: they turn products into sums, and huge ranges into small ones.
Free sample. Everything in this module opens with a free account.Video in production.
Learn
In this lesson12 parts
- 01The inverse of the exponential
- 02Powers, roots and negative exponents
- 03The number e and the exponential function
- 04The logarithm and the natural log
- 05The product rule for logarithms
- 06Ten probabilities: product against sum of logs
- 07Checkpoint: exponents and logarithms
- 08Odds and log-odds
- 09Scoring one email as a product and as a sum of logs
- 10Log axes and log1p on course data
- 11Exponentials and logarithms in NumPy
- 12Recap, challenge, and next: reading ML notation
Key terms
The words this lesson introduces, each in one line. The module’s glossary collects them all.
- base**, **exponent
- in
bⁿ,bis the base andncounts how many times it is multiplied |2³ = 2 × 2 × 2 - power
bⁿ|2⁵ = 32- root
b^(1/n), the number whosenth power isb|2^½ = 1.4142- e
- the base whose exponential has slope one at zero,
2.71828…| slope1.0005at step0.001 - exponential function
exp(x) = eˣ|np.exp(1) = 2.718281828459045- logarithm
- the exponent that gives a number |
log₁₀ 1000 = 3 - natural log
ln - the logarithm with base
e|ln 0.5 = −0.6931 - inverse function
- a function that undoes another; its graph is the reflection across
y = x|lnundoesexp - product rule
log(ab) = log a + log b|ln 0.1 = −2.3026- scientific notation
- a number times a power of ten; Python writes it
3.6e-06|3.6 × 10⁻⁶ - log scale
- an axis where equal distances are equal ratios |
1, 0.1, 0.01evenly spaced - odds
p / (1 − p)|4forp = 0.8- log-odds (logit)
ln(p / (1 − p)); the sigmoid turns it back into a probability |1.3863forp = 0.8- common mistake:
log(a + b) - the rule is for a product;
log(a + b)is notlog a + log b|ln 0.7 = −0.3567, not−2.3026 - common mistake:
np.logof zeros - gives
-infwith a warning, not an error; usenp.log1p|108cells of the email counts
Quiz
Your first pick on each question is the one that counts, and a right one earns a coin. Getting one wrong here is how the lesson sticks.