๐ฏ What It Is
Mean Squared Error (MSE) is a way to measure how wrong a model’s predictions are.
It tells you how far off your predictions are from the actual (true) values.
๐งฎ Formula:
MSE=n1i=1∑n(yi−yi^)2Where:
-
yi = actual (true) value
-
yi^ = predicted value
-
n = number of samples
⚙️ Step-by-Step:
-
Find the error for each prediction: (yi−yi^)
-
Square the error → makes all values positive and punishes big errors more
-
Average them → gives the mean squared error
๐ Example:
| Actual (y) | Predicted (ลท) | Error | Squared Error |
|---|---|---|---|
| 4 | 5 | -1 | 1 |
| 2 | 3 | -1 | 1 |
| 6 | 5 | 1 | 1 |
| 3 | 2 | 1 | 1 |
๐ก Why It’s Used
-
It gives a single number that shows overall prediction quality.
-
Smaller MSE → better model
-
Commonly used in regression tasks and training neural networks (as a loss function).
๐ฅ Intuition:
MSE measures the average squared distance between your predictions and the truth.
The closer to 0, the better your model fits the data.
Would you like me to explain how MSE is used to train neural networks (via gradient descent)?
Eample : You’re trying to guess someone’s height ๐ฏ
If they say they’re 160 cm, and you guess 170 cm, you’re 10 cm off.
Now let’s see how Mean Squared Error (MSE) works — explained like you’re 10 ๐
๐ Step-by-Step:
-
You make several guesses.
Example:True height Your guess Error 160 170 +10 150 145 -5 180 190 +10 -
You take the difference (error) for each guess.
-
You square each error (so negative numbers don’t cancel out):
102=100, (−5)2=25, 102=100 -
You average them all:
(100+25+100)/3=75
That’s your Mean Squared Error = 75
๐ง What It Means:
-
If MSE = big number → your guesses are way off ❌
-
If MSE = small number → your guesses are close ✅
๐ฌ In short:
MSE tells you how wrong your guesses are —
it’s like checking how far your dart hits are from the bullseye ๐ฏ,
but you square the distance so big misses hurt extra!
No comments:
Post a Comment