Skip to content

Instantly share code, notes, and snippets.

Avatar
💻

Krishnan Srinivasan krishpop

💻
View GitHub Profile
View RandomForest.py
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))