Course Content
Statistics & Math for AI/ML Interviews
8 sections · 30 lessons
Why is standard deviation more commonly used than variance in ML analysis?
What you need to know
Units are the whole story for reporting
If price is in rupees, variance is in rupees squared. Nobody can picture "₹² 2,50,000". Its square root, ₹500, can be compared directly with the mean price and with any single price. The same is true for model error: RMSE (the square root of MSE) is in the target's units, which is why teams report RMSE rather than MSE.
Why variance is still used in the maths
For independent variables, variances add. Standard deviations do not.
Var(X + Y) = Var(X) + Var(Y) when X and Y are independentSD(X + Y) = square root of (Var(X) + Var(Y))Worked example. Kitchen preparation time has an SD of 3 minutes. Rider travel time has an SD of 4 minutes. They are independent. What is the SD of total delivery time?
Var(total) = 3^2 + 4^2 = 9 + 16 = 25SD(total) = square root of 25 = 5 minutes (not 3 + 4 = 7)A quick simulation confirms it:
1import numpy as np23rng = np.random.default_rng(0)4prep = rng.normal(15, 3, 100_000) # kitchen prep, SD 3 min5ride = rng.normal(20, 4, 100_000) # rider travel, SD 4 min6total = prep + ride78print("var prep + var ride:", round(prep.var() + ride.var(), 1))9print("var of total :", round(total.var(), 1))10print("sd of total :", round(total.std(), 2))var prep + var ride: 25.1var of total : 25.1sd of total : 5.01This additivity is why variance appears in so many derivations: the bias–variance decomposition (expected error = bias squared + variance + noise), PCA's "explained variance ratio", and the standard error of a mean.
Standard deviation
- Same units as the data
- Used for z-scores, error bars, outlier rules
- What you report to people
Variance
- Squared units
- Adds up for independent variables
- What the formulas and loss functions use
A real-life example
A checkout team runs an A/B test on a new "Pay now" button. Daily revenue per user has a mean of ₹210 and an SD of ₹180. The analyst writes "variance = 32,400" in the report, and the product manager has no idea whether that is large.
Rewritten as "₹210 average with an SD of ₹180 — revenue per user is very noisy", everyone understands why the test needs many users. Behind the scenes, the sample-size calculation still uses the variance, because the variance of an average of n users is the variance divided by n.
Follow-up questions to expect
- "Why is RMSE reported instead of MSE?" — RMSE is in the target's units, so "RMSE of 4.2 minutes" can be compared directly to delivery times; MSE is in minutes squared.
- "Do standard deviations ever add?" — Only when the variables are perfectly positively correlated. For independent variables, add the variances and take the square root.
- "What is the standard error?" — The SD of a sample mean across repeated samples, equal to SD / square root of n. It shrinks as the sample grows.