text_html_output_1.png
import numpy as np

dataset.columns

df = dataset.drop(columns=['date', 'id'])
df1 = df.dropna()

df.columns

X = df.drop(columns=['price'])[:10]
y = df['price'][:10]

X_test = df.drop(columns=['price'])[:10]
X_test

X = df.drop(columns=['price'])[:10]
y = df['price'][:10]

X = df.drop(columns=['price'])[:10]
y = df['price'][:10]
X_b = np.c_[np.ones((10, 1)), X]
X = X.to_numpy()
y = y.to_numpy()

eta = 0.1
n_iterations = 10
m = 100
theta = np.random.randn(19, 1)
for iteration in range(n_iterations):
    gradients = 2 / m * X_b.T.dot(X_b.dot(theta) - y)
    theta = theta - eta * gradients
theta