From e661b035dac72084dde14268548c94437be5ec84 Mon Sep 17 00:00:00 2001 From: koustav01 <71479361+koustav01@users.noreply.github.com> Date: Sat, 3 Oct 2020 22:09:50 +0530 Subject: [PATCH] Update SLR.py --- 1-Basic/Simple_Linear_Regression/SLR.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-Basic/Simple_Linear_Regression/SLR.py b/1-Basic/Simple_Linear_Regression/SLR.py index 6c5c8d9..f29205e 100644 --- a/1-Basic/Simple_Linear_Regression/SLR.py +++ b/1-Basic/Simple_Linear_Regression/SLR.py @@ -8,7 +8,7 @@ def fitSLR(x, y): dinominator = 0 numerator = 0 for i in range(0, n): - numerator += (x[i] - np.mean(x)) * (y[i] - np.mean(y)) + numerator += (x[i] - np.mean(x)) * (y[i] - np.mean(y)) # np.mean() compute mean of whole array/list {much faster than normal python} dinominator += (x[i] - np.mean(x)) ** 2 print("numerator:" + str(numerator))