Skip to content

Instantly share code, notes, and snippets.

View krishpop's full-sized avatar
💻

Krishnan Srinivasan krishpop

💻
  • United States
View GitHub Profile
import numpy as np
import matplotlib.pyplot as plt
def basic_linear_reg(x, y):
# linear reg on 2 axes
length = len(x)
sum_x = sum(x)
sum_y = sum(y)
sum_xsq = sum(map(lambda a: a * a, x))
sum_xy = sum(map(lambda a, b: a * b, x, y))