text_plain_output_1.png
from sklearn.linear_model import LinearRegression

import numpy as np

import pandas as pd

dataset.columns

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

df.columns

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

model = LinearRegression()
model.fit(X, y)

model.score(X, y)

model.intercept_

model.coef_

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

y_hat = model.predict(X_test)

dc = pd.concat([df[:10].reset_index(), pd.Series(y_hat, name='predicted')], axis='columns')
dc

data = pd.read_csv('../input/kc-house-data/kc_house_data.csv')
X1 = data.drop(columns=['price', 'id', 'date', 'sqft_above'])[:200]
y1 = data['price'][:200]
X_b = np.c_[np.ones((200, 1)), X1]
X1.info()