# Drop highly correlated features if you are confident that they may add bias into the model
corr_df = df.corr(method='pearson') # could also be 'spearman' or 'kendall'
mask = np.triu(np.ones_like(corr_df, dtype=bool))
sns.heatmap(corr_df, mask=mask, center=0, linewidths=1, annot=True, fmt=".2f")
# Alternative approach
corr_df = df.corr().abs()
mask = np.triu(np.ones_like(corr_df, dtype=bool))
tri_df = corr_df.mask(mask)
to_drop = [c for c in tri_df.columns if any(tri_df[c] > 0.95)]
reduced_df = chest_df.drop(to_drop, axis=1)
# Different concept : Hierarchical heatmap (similar columns are put closely together)
sns.clustermap(corr_df)