<jupyter_start><jupyter_text>Table of Contents1&nbsp;&nbsp;Importing Libraries2&nbsp;&nbsp;Loading Data3&nbsp;&nbsp;Modelling4&nbsp;&nbsp;Evaluation  Importing Libraries<jupyter_code>import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline<jupyter_output><empty_output><jupyter_text>Loading Data<jupyter_code>df = pd.read_csv('Datasets/house_data.csv')
df.head()
df.describe()
df.info()<jupyter_output><class 'pandas.core.frame.DataFrame'>
RangeIndex: 21613 entries, 0 to 21612
Data columns (total 21 columns):
 #   Column         Non-Null Count  Dtype  
---  ------         --------------  -----  
 0   id             21613 non-null  int64  
 1   date           21613 non-null  object 
 2   price          21613 non-null  float64
 3   bedrooms       21613 non-null  int64  
 4   bathrooms      21613 non-null  float64
 5   sqft_living    21613 non-null  int64  
 6   sqft_lot       21613 non-null  int64  
 7   floors         21613 non-null  float64
 8   waterfront     21613 non-null  int64  
 9   view           21613 non-null  int64  
 10  condition      21613 non-null  int64  
 11  grade          21613 non-null  int64  
 12  sqft_above     21613 non-null  int64  
 13  sqft_basement  21613 non-null  int64  
 14  yr_built       21613 non-null  int64  
 15  yr_renovated   21613 non-null  int64  
 16  zipcode        21613 non-null  int64  
 17  lat            21613 non-null  float64
 18  long  [...]<jupyter_text>no null values<jupyter_code>plt.scatter(df['sqft_living'],df['price']);
df.set_index('id',inplace=True)
y = df['price']
X = df.drop(['price','date'],axis= 1)<jupyter_output><empty_output><jupyter_text>Modelling<jupyter_code>from sklearn.linear_model import LinearRegression
model = LinearRegression(normalize = True,n_jobs = -1)
from sklearn.model_selection import train_test_split
X_train,X_test,y_train,y_test = train_test_split(X,y,test_size=0.2)
X_train.shape,X_test.shape
model.fit(X_train,y_train)<jupyter_output><empty_output><jupyter_text>Evaluation<jupyter_code>model.score(X_train,y_train)
model.score(X_test,y_test)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09943714821763602, 'fraction_numerical': 0.08114446529080675, 'mean_word_length': 3.397938144329897, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '606941', 'license': 'MIT', 'n_tokens_mistral': 892, 'n_tokens_neox': 767, 'n_words': 162, 'path': 'House Prices.ipynb', 'repo_name': 'prikshit-2000/Machine-Learning-Assignments', 'size': '2132'}