Member-only story
If you jump into the loss functions in machine learning algorithms, you might encounter many logarithms. Why?
- What is a logarithm
- The traits of the logarithm
- Why do we use it in machine learning
1. What is a logarithm
A logarithm is the inverse of an exponential.
a^x = y
log_a(y) = x
x means how many times a multiplied by itself. A common one is a =10.
10^2 = 100
log_10(100) = 2
2. The traits of the logarithm
(1) It turns multiplication into addition
One rule of logs is that log(A*B*C) = log(A) + log(B) + log(C)
log{(2%)*(3%)*(4%)}= log(2%) + log(3%) + log(4%)
The output of (2%)*(3%)*(4%) is really small 0.000024, on the other hand, log(2%) + log(3%) + log(4%) is (-1.699) + (-1.523) +(-1.398) = -4.62
(2) It makes the exponential relationships easier to interpret