image_output_11.png image_output_24.png image_output_25.png image_output_17.png image_output_30.png image_output_14.png image_output_39.png image_output_28.png image_output_23.png image_output_34.png image_output_13.png image_output_40.png image_output_5.png image_output_18.png image_output_21.png image_output_7.png image_output_31.png image_output_20.png image_output_32.png image_output_4.png image_output_42.png image_output_35.png image_output_41.png image_output_36.png image_output_8.png image_output_37.png image_output_16.png image_output_27.png image_output_6.png image_output_12.png image_output_22.png image_output_3.png image_output_29.png image_output_43.png image_output_2.png image_output_1.png image_output_10.png image_output_33.png image_output_15.png image_output_9.png image_output_19.png image_output_38.png image_output_26.png
import pandas as pd

train_data = pd.read_csv('../input/house-prices-advanced-regression-techniques/train.csv')
test_data = pd.read_csv('../input/house-prices-advanced-regression-techniques/test.csv')

train_data.shape

cat_data = train_data.select_dtypes(include='object')
cat_cols = cat_data.columns
num_data = train_data.select_dtypes(exclude='object')
num_cols = num_data.columns
num_to_cat_cols = ['MSSubClass', 'MoSold', 'YrSold', 'OverallQual', 'OverallCond']
num_cols = [i for i in num_cols if not i in num_to_cat_cols]
num_cols = [i for i in num_cols if not i in ['Id']]
num_data = num_data.drop(['Id', 'MSSubClass', 'MoSold', 'YrSold', 'OverallQual', 'OverallCond'], axis=1)

corr_matrix = train_data[num_cols].corr()
corr_matrix['SalePrice'].sort_values(ascending=False)