text_html_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)

predicted = regr.predict([[2, 3, 1680, 2180]])
print('predicted with [2.0,3.0,1680,2180] so, price :', predicted)
predicted = regr.predict([[2.75, 4.0, 1400, 2490]])
print('predicted with [2.75,4.0,1400,2490] so, price :', predicted)
predicted = regr.predict([[8.0, 7.0, 9410, 13540]])
print('predicted with [8.0,7.0,9410,13540] so, price :', predicted)
predicted = regr.predict([[1.0, 0.0, 0.0, 0.0]])
print('predicted with bathrooms in 1 unit so, price :', predicted)
predicted = regr.predict([[0.0, 1.0, 0.0, 0.0]])
print('predicted with bedrooms in 1 unit so, price :', predicted)
predicted = regr.predict([[1.0, 0.0, 1.0, 0.0]])
print('predicted with sqft_above in 1 unit so, price :', predicted)
predicted = regr.predict([[0.0, 0.0, 0.0, 1.0]])
print('predicted with sqft_living in 1 unit so, price :', predicted)