Lambda mathematical notation
The lambda symbol λ is the Greek letter l. It has no single meaning: in linear algebra it is an eigenvalue, in machine learning the strength of a regularization penalty, in probability an event rate, in physics a wavelength, and in computer science the start of an anonymous function.
Read it as: lambda, LAM-duh.
Type it: Unicode U+03BB (capital Λ is U+039B) · HTML λ · LaTeX \lambda
Mac: switch to the Greek keyboard layout and press L, or press Globe-E and search for lambda.
Windows: in Word, type 03BB and press Alt+X. Elsewhere, copy it from Character Map.
Eigenvalue: An eigenvalue of a square matrix A: a number λ for which Av = λv holds for some nonzero vector v. Multiplying that eigenvector by A only scales it by λ.
$$\begin{pmatrix}2&1\\1&2\end{pmatrix}\begin{pmatrix}1\\1\end{pmatrix}=\begin{pmatrix}3\\3\end{pmatrix}=3\begin{pmatrix}1\\1\end{pmatrix}$$
So λ = 3 is an eigenvalue with eigenvector (1, 1). Solving det(A − λI) = (2 − λ)² − 1 = 0 also gives λ = 1, with eigenvector (1, −1). In PCA, the eigenvalues of the covariance matrix are the variances along the principal directions.
An eigenvector is only fixed up to scale: any nonzero multiple of (1, 1), such as (2, 2), is also an eigenvector for λ = 3.
Regularization strength: The weight on a penalty term added to a loss. A larger λ pushes the weights toward zero: the model fits the training data less closely and often generalizes better.
$$\mathcal L(w)=\frac1n\sum_{i=1}^n\left(y_i-w^\top x_i\right)^2+\lambda\lVert w\rVert_2^2$$
With one weight, a data loss of (w − 2)² and λ = 1: the derivative 2(w − 2) + 2λw is zero at w = 2/(1 + λ) = 1, half the unregularized answer w = 2.
Libraries rename it. scikit-learn's Ridge calls it alpha, its LogisticRegression takes C, the inverse of the strength, and PyTorch optimizers take weight_decay.
Rate: The average number of events per unit of time in a Poisson process. The count in one unit of time is Poisson with mean λ, and the wait between events is exponential with mean 1/λ.
$$P(N=k)=\frac{\lambda^k e^{-\lambda}}{k!}$$
A server that receives λ = 3 requests per second on average has a chance P(N = 0) = e⁻³ ≈ 0.050 of a second with no requests, and the mean gap between requests is 1/3 second.
Some texts give the exponential distribution by its mean β = 1/λ instead of its rate. NumPy's random.exponential takes scale = 1/λ, so a rate of 3 is scale=1/3.
Wavelength: The distance between neighboring crests of a wave. Wavelength and frequency f are tied by the wave's speed: c = λf for light and radio waves.
$$\lambda=\frac{c}{f}=\frac{3.0\times10^{8}\ \text{m/s}}{2.4\times10^{9}\ \text{Hz}}=0.125\ \text{m}$$
A 2.4 GHz Wi-Fi signal has a wavelength of about 12.5 cm.
Here λ is a length with units. A wavelength in nanometers differs from one in meters by a factor of 10⁹, so check units before reusing a physics formula.
Anonymous function: In lambda calculus, λx. M is a function of x whose result is the expression M. Python's lambda keyword and lambda functions in other languages are named after this notation.
$$(\lambda x.\,x^2+1)\;3=3^2+1=10$$
Applying λx. x² + 1 to 3 substitutes 3 for x and gives 10, the same result as Python's (lambda x: x**2 + 1)(3).
The x after λ is a bound variable, so λx. x + 1 and λy. y + 1 are the same function. AWS Lambda borrows the name only.