I found two different and contradictory definitions / interpretations of $R2$. They cannot be true at the same time and I don't know how to tell which one is true.
- $R^2$ is just a square of Pearson's correlation. Hence its value ranges between $[0, 1]$
- $R^2$ is equal to $$1 - \dfrac{SSE}{SST}$$
and can be negative if the model is worse than random. For example - in Python's sklearn function r2_score can return a negative number.
Are those two different $R^2$s? Why are there two contradictory definitions? Can anyone explain it comprehensively?