I'm trying to understand fraction of unexplained variance on wikipedia: https://en.wikipedia.org/wiki/Fraction_of_variance_unexplained
$$\text{unexplained variance} (y, \hat y) =\frac{\operatorname{Var}\{y-\hat y\}}{\operatorname{Var}\{y\}}$$
Correct me if I'm wrong, it's basically find out the variance between the difference of the expected value $y$ and predicted value $\hat y$, where $y$ is the real value, and $\hat y$ is the predicted value.
In a linear regression setup: $\hat y=mx+c+e$, where $e$ is the error term (residual or unexplained error). So if $e$ is $0$ for all predictions, then the unexplained variance would be $0$, since there is no variance.
However, $\operatorname{unexplained variance} (y, \hat y) =\dfrac{\operatorname{Var}\{y-\hat y\}}{\operatorname{Var}\{y\}}= \frac{SS_\text{err}}{SS_\text{tot}}$ is the confusion part.
$$SS_\text{err}(\text{Residual Sum of Squares})=\sum_{i=0}^n (y_i-\hat y_i)^2$$
$SS_\text{tot}(\text{Total Sum Of Squares})=\sum_{i=0}^n (y_i-\bar y_i)^2$, where $\bar y_i$ is the average value.
$\operatorname{Var}\{y-\hat y\}=E[((y-\hat y)-\sum_{i=0}^n(y-\hat y))^2]$, somehow this does not look like Residual sum of squares?