Interpretation of $R^2$ (coefficient of determination) 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?

If you fit both slope and intercept with linear regression, both your definitions will be true (and both give the same value of $R^2$).
If you only fit one of those (slope or intercept) and constrain the other to a fixed value (often the intercept is forced to equal 0), then the second definition is correct but the first definition will be wrong. And in this case, yes $R^2$ can be negative:
What does negative R-squared mean?
