I was going through the documentation to understand the Coefficient of Determination and from the document i got an understanding that Coefficient of Determination is nothing but R x R (correlation coefficient)
so i took the housing price dataset from kaggle.com and started to try on it for better understanding, this is my code
took the correlation coefficient
test_data=pd.read_csv(r'\house_price\test.csv')
_d=test_data.loc[:,['MSSubClass','LotFrontage']]
_d.fillna(0,inplace=True)
_d.corr()
now, taking the Coefficient of Determination like this
from sklearn.metrics import r2_score
r2_score(_d['MSSubClass'],_d['LotFrontage'])
for which, i got the value -0.9413195412943647
ideally shouldnt it be 0.060531252961 ? as -0.246031 x -0.246031 = 0.060531252961