Skip to content

Instantly share code, notes, and snippets.

@vikramsoni2
Created October 5, 2018 10:45
Show Gist options
  • Save vikramsoni2/e61e0e2d6eca66a7a5577fc0dc368007 to your computer and use it in GitHub Desktop.
Save vikramsoni2/e61e0e2d6eca66a7a5577fc0dc368007 to your computer and use it in GitHub Desktop.
pearson correlation matrix
features = ['bedrooms', 'bathrooms', 'sqft_living',
'sqft_lot', 'floors', 'waterfront', 'view', 'condition', 'grade',
'sqft_above', 'sqft_basement', 'yr_built', 'yr_renovated', 'zipcode',
'sqft_living15', 'sqft_lot15']
f, ax = plt.subplots(figsize=(16, 12))
plt.title('Pearson Correlation Matrix',fontsize=25)
sns.heatmap(df[features].corr(), linewidths=0.25, vmax=1.0, square=True, cmap="BuGn_r", linecolor='k', annot=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment