image_output_1.png
from sklearn.linear_model import LinearRegression

import matplotlib.pyplot as plt

import pandas as pd

df = pd.read_csv('../input/islamabad-house-prices/isb_data.csv')
df.shape

df.isnull().sum()

df.dtypes

temp = pd.DataFrame(index=df.columns)
temp['data_type'] = df.dtypes
temp['null_count'] = df.isnull().sum()
temp['unique_count'] = df.nunique()

X = df[['Total_Area', 'price', 'bedrooms', 'baths']]
y = df['price']

lr = LinearRegression()

lr.fit(X_train, y_train)

coeff_df = pd.DataFrame(lr.coef_, X.columns, columns=['Coefficient'])
coeff_df