Skip to content

Instantly share code, notes, and snippets.

price size
0 980000 49
1 980000 49
3 1550000 118
4 1350000 86
5 2400000 75
6 980000 49
7 1300000 66
8 1950000 122
9 980000 49
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
df = pd.read_csv('houses_prices.csv')
class LinearRegssion:
def __init__(self, d, step=0.000005, max_iteration=1000):
self.theta = np.random.randn(d + 1)
self.step = step
self.max_iteration = max_iteration