Imagine you're throwing darts at a target, and we want to measure how good you are.
MAE is like this: After each throw, measure how far the dart is from the bullseye (in centimeters), add them all up, and divide by number of throws. If you're3 cm off, then 5 cm off, then 2 cm off, your average is (3+5+2)/3 = 3.3 cm. Easy!
MSE is different: Instead of just measuring distance, we square it. So 3 cm becomes 9, 5 cm becomes 25, and 2 cm becomes 4. Average is (9+25+4)/3 = 12.7. Notice the 5 cm throw (which was only a bit worse) now counts way more (25 vs. 9). We're punishing big mistakes extra hard!
RMSE is just taking the square root of that12.7, getting 3.6 cm back. We squared to punish big mistakes, then un-squared to get normal units back.
MAPE is for when the target itself changes size. Imagine three dart boards: one is tiny (10 cm across), one is medium (100 cm), one is huge (1000 cm). A5 cm miss on the tiny board is "50% of the board!", but on the huge board it's only "0.5% off." MAPE measures your error as a percentage of the board size, so it's fair across different boards.
Feature scaling - MAPE invariant to scale, MAE/MSE/RMSE affected by target range
#flashcards/ai-ml
What are the four basic regression metrics and their acronyms? :: MAE (Mean Absolute Error), MSE (Mean Squared Error), RMSE (Root Mean Squared Error), MAPE (Mean Absolute Percentage Error)
Write the formula for MAE :: MAE=n1∑i=1n∣yi−y^i∣ where yi is actual, y^i is predicted
What are the units of MAE?
Same units as the target variable (interpretable: dollars, meters, etc.)
Write the formula for MSE
MSE=n1∑i=1n(yi−y^i)2
What are the units of MSE and why is this a problem?
Squared units of target (dollars², meters²); not directly interpretable, but mathematically convenient for optimization
Why does MSE penalize large errors more than small errors?
Because errors are squared; a 10-unit error becomes 100 (not 10), while a 2-unit error becomes 4; the ratio is 25:1 instead of 5:1
Write the formula for RMSE
RMSE=MSE=n1∑i=1n(yi−y^i)2
What is the relationship between RMSE and MAE? :::≥ MAE always; when RMSE >> MAE, there are large outlier errors; when RMSE ≈ MAE, errors are uniformly distributed
Write the formula for MAPE
MAPE=n100%∑i=1n∣yi∣∣yi−y^i∣
What are the units of MAPE? :: Percentage (dimensionless); allows comparison across different scales
What is the critical limitation of MAPE?
Undefined when actual value yi=0 (division by zero); also asymmetric (penalizes overestimation differently than underestimation)
When should you use MAE over MSE?
When you want equal weighting of all errors, interpretable units, and robustness to outliers; when errors should scale linearly with magnitude
When should you use RMSE over MAE?
When large errors are disproportionately costly and you want to penalize them more, but still need interpretable units in original scale
When should you use MAPE?
When target variable spans multiple orders of magnitude and relative error matters more than absolute error; when stakeholders think in percentages
Why is MSE preferred during model training even though RMSE is more interpretable?
MSE is differentiable everywhere (smooth gradient), making gradient descent optimization more stable; RMSE's square root introduces numerical instability near zero
What does it mean if RMSE is much larger than MAE?
There are large outlier predictions; the model has some catastrophically wrong predictions that are driving up the squared error
If Model A has errors [2,2,2,2] and Model B has errors [0,0,0,8], calculate MAE and MSE for both. Which metric prefers which model?
Model A: MAE=2, MSE=4; Model B: MAE=2, MSE=16; MAE says tied, MSE strongly prefers A (4 vs 16); demonstrates metric choice matters
What is metric shopping and why is it bad?
Choosing your evaluation metric after seeing results to get the best numbers; it's a form of overfitting/cherry-picking; metric must be chosen before training based on requirements
What is a better alternative to MAPE that fixes its asymetry?
Why can't you directly compare MAE values across datasets with different scales?
MAE is in original units; a MAE of 100 means different things for house prices (100Kscale)vs.apartmentrents(1K scale); MAPE would allow fair comparison
Regression metrics samajhne ke liye ek simple sawal se shuru karte hain: jab apka model continuous values predict kar raha hai (jaise ghar kimat, temperature, ya sales), to apko kaise pata chalega ki model kitna acha hai? Bas yeh dekhna kafi nahi ki "prediction galat hai" - apko yeh measure karna padega ki kitna galat hai aur kis tarah se galat hai.
Chaar main metrics hain jo yeh kaam karte hain. MAE (Mean Absolute Error) sabse seedha hai - har prediction ki galti ko positive number mein convert karo (absolute value), phir average nikalo. Yeh apko bolta hai ki "average mein, apka model itne units se off hai." MSE (Mean Squared Error) thoda different approach leta hai - errors ko square kar deta hai.Iska matlab ki badi galtiyan choti galtiyon se zyada zyada penalize hoti hain.Agar ek jagah 10 units ka error hai aur dosri jagah 2 units ka, to MSE mein 10-unit-wali galti 25 guna zyada contribute karegi (100 vs 4), jabki MAE mein sirf 5 guna (10 vs 2). RMSE bas MSE ka square root hai taki units wapas normal ho jayein - interpretability wapas aa jati hai lekin badi galtiyon ki sensitivity bhi bani rehti hai.
MAPE (Mean Absolute Percentage Error) tab use hota hai jab aapka data bahut alag-alag scales mein hai. Suppose ek product100 rupees ka hai aur dosra 10,000 ka - dono pe50 rupay ka error same nahi hai na? MAPE percentage mein bata hai, to100-wali pe 50% error dikhega aur 10,000-wali pe 0.5%. Lekin dhyan rahe, MAPE tab kaam nahi karta jab actual value zero ho (division by zero), aur yeh asymmetric bhi hai - over-predict aur under-predict ko alag tarike se treat karta hai. Machine learning mein sahi metric choose karna bahut zarori hai kyunki har metric alag chez optimize karta hai - koi outliers ko punish karta hai, koi equal treatment deta hai, koi percentage mein sochta hai. Aapke business requirement ke hisaab se pehle se decide karo, training ke bad nahi!