text_plain_output_1.png
from sklearn import linear_model

import matplotlib.pyplot as plt

import pandas as pd

import seaborn as sns

df = pd.read_csv('../input/housedata/output.csv')

corr = df.corr()

x = df[['bathrooms', 'bedrooms', 'sqft_above', 'sqft_living']]
y = df['price']
regr = linear_model.LinearRegression()
regr.fit(x.values, y)

df.isnull().sum()

def function(x, a):
    f = a[2] * x * x + a[1] * x + a[0]
    return f
def grad(x, a):
    g = 2 * a[2] * x + a[1]
    return g
x = df[['bathrooms', 'bedrooms', 'sqft_above', 'sqft_living']]
y = df['price']
f = function(x, y)

x = df[['bedrooms']]
y = df['price']
plt.plot(x, y, 'r.')