<jupyter_start><jupyter_text>IRENE UMOH 17100310866<jupyter_code>import pandas as pd
data = pd.read_csv('NYC_Property_Data.csv')
data
data.isnull().sum()
data.dropna(how='any', inplace=True)
data.describe?
data.isnull().sum()
features = data.drop(['Unnamed: 0', 'Unnamed: 0.1', 'ADDRESS', 'SALE PRICE', 'SALE DATE','ZIP CODE'], axis = 1)
features.head()
target = data['SALE PRICE']
target.head()
from sklearn.preprocessing import LabelEncoder
le = LabelEncoder() 
features['NEIGHBORHOOD'] = le.fit_transform(features['NEIGHBORHOOD'])
features['BUILDING CLASS CATEGORY'] = le.fit_transform(features['BUILDING CLASS CATEGORY'])
features['TAX CLASS AT PRESENT'] = le.fit_transform(features['TAX CLASS AT PRESENT'])
features['BUILDING CLASS AT PRESENT'] = le.fit_transform(features['BUILDING CLASS AT PRESENT'])
features['BUILDING CLASS AT TIME OF SALE'] = le.fit_transform(features['BUILDING CLASS AT TIME OF SALE'])
features
from sklearn.model_selection import train_test_split
features_train, features_test, target_train, target_test = train_test_split(features,target, test_size = 0.2, random_state = 0)
features_train
from sklearn.linear_model import LinearRegression
regressor = LinearRegression()
model = regressor.fit(features_train, target_train)
target_pred = model.predict(features_test)
pd.DataFrame({'Actual': target_test, 'Predicted': target_pred, 'Error': target_test-target_pred})<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13009845288326302, 'fraction_numerical': 0.012658227848101266, 'mean_word_length': 8.614864864864865, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '452185', 'license': 'MIT', 'n_tokens_mistral': 497, 'n_tokens_neox': 463, 'n_words': 106, 'path': 'IRENE UMOH Week 4 Assignment.ipynb', 'repo_name': 'ireneumoh24/ISM-415', 'size': '1422'}