Verify that R-squared equals squared correlation in simple linear regression
Role: Data Scientist
Category: Machine Learning
Difficulty: easy
Interview Round: Other
Overview: Implement a Python function that fits a simple linear regression with an intercept, computes R-squared from the residuals, and returns it alongside the squared Pearson correlation of the inputs. It tests OLS fitting, sums of squares, and when this identity stops holding.