<jupyter_start><jupyter_text>06_Business_Insights In this section, we will expend upon the features used by the model and attempt to explain its significance as well as contributions to the pricing model.Accordingly, in Section Four, we identified the following key features that that are strong predictors of housing price based upon a combination of feature engineering coupled with recursive feature elimination.  $$ \hat{y} = \beta_0 + \begin{align} \beta_1\textit{(age_since_built)} + \beta_2\textit{(Gr_Liv_Area)} + \beta_3\textit{(Total_Bsmt_SF)} + \beta_4\textit{(house_exter_score)} + \beta_j\textit{(Land_Contour)}_j  \end{align}$$   Where:  $\textit{house_exter_score}$ = ['Overall Qual'] + ['Overall Cond'] +['Exter Qual'] + ['Exter Cond'] | Score  || --- ||age_since_built ||Total Bsmt SF ||Land Contour_Lvl ||house_exter_score ||Gr Liv Area ||Land Contour_Low ||Land Contour_HLS |<jupyter_code># model coefficients
prod_model_rfe<jupyter_output><empty_output><jupyter_text>Import Libraries<jupyter_code>import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns 
import matplotlib.ticker as ticker

%matplotlib inline
rfe_columns = ['Total Bsmt SF', 'Gr Liv Area', 'age_since_built', 'house_exter_score',
       'Land Contour_HLS', 'Land Contour_Low', 'Land Contour_Lvl']<jupyter_output><empty_output><jupyter_text>Load in Training Set for Exploration<jupyter_code>train = pd.read_csv('./datasets/imputed_train.csv')
new_train = train[(train['Total Bsmt SF']<4000) & (train['Total Bsmt SF']>0)]
plt.figure(figsize=(15,10))
ax = sns.scatterplot(x='Total Bsmt SF',y='SalePrice',data=new_train,hue='Total Bsmt SF')
ax.set_title("Total Basement Area against Sale Prices", fontname='Helvetica', fontsize=18,loc='left')
ax.set_xlabel('Total Basement Area / SqFt',fontname='Helvetica',fontsize=12)
ax.set_ylabel('Sale Price / $',fontname='Helvetica',fontsize=12)
plt.savefig("./img/bsmt_area.png",dpi=300)
plt.figure(figsize=(15,10))
ax = sns.scatterplot(x='age_since_built',y='SalePrice',data=new_train,hue='age_since_built')
ax.set_title("Building Age against Sale Prices", fontname='Helvetica', fontsize=18,loc='left')
ax.set_xlabel('Building Age / yr',fontname='Helvetica',fontsize=12)
ax.set_ylabel('Sale Price / $',fontname='Helvetica',fontsize=12)
plt.savefig("./img/building_age.png",dpi=300)
train.columns
plt.figure(figsize=(15,10))
ax = sns.pointplot(x='house_exter_score',y='SalePrice',data=new_train)
ax.set_title("Housing Scores against Sale Prices", fontname='Helvetica', fontsize=18,loc='left')
ax.set_xlabel('Score',fontname='Helvetica',fontsize=12)
ax.set_ylabel('Sale Price / $',fontname='Helvetica',fontsize=12)
for ind, label in enumerate(ax.get_xticklabels()):
    if ind % 5 == 0:  # every 10th label is kept
        label.set_visible(True)
    else:
        label.set_visible(False)

plt.savefig("./img/housing_score.png",dpi=300)
plt.figure(figsize=(15,10))
ax = sns.scatterplot(x='Gr Liv Area',y='SalePrice',data=new_train,hue='Gr Liv Area')
ax.set_title("Living Area against Sale Prices", fontname='Helvetica', fontsize=18,loc='left')
ax.set_xlabel('Living Area / Sqft',fontname='Helvetica',fontsize=12)
ax.set_ylabel('Sale Price / $',fontname='Helvetica',fontsize=12)
plt.savefig("./img/living_area.png",dpi=300)
new_train_melt = new_train[['Land Contour_Low', 'Land Contour_HLS','Land Contour_Lvl','SalePrice']].melt(id_vars='SalePrice' ,value_vars=['Land Contour_Low', 'Land Contour_HLS','Land Contour_Lvl'])

plt.figure(figsize=(15,10))
ax = sns.boxplot(x='variable',y='SalePrice',order=['Land Contour_Lvl','Land Contour_Low','Land Contour_HLS'],data=new_train_melt[new_train_melt['value']!=0])
ax.set_title("Land Contours and relationship to Sale Prices", fontname='Helvetica', fontsize=18,loc='left')
ax.set_xlabel('Score',fontname='Helvetica',fontsize=12)
ax.set_ylabel('Sale Price / $',fontname='Helvetica',fontsize=12)
plt.savefig("./img/contour_plot.png",dpi=300)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15663560815915387, 'fraction_numerical': 0.02064971040040292, 'mean_word_length': 8.110091743119266, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '4310', 'license': 'MIT', 'n_tokens_mistral': 1509, 'n_tokens_neox': 1435, 'n_words': 270, 'path': 'project_2/06_Production_Model_Insights.ipynb', 'repo_name': 'bearylogical/ga-test', 'size': '3971'}