Read a Correlation Heatmap
Spotting redundant features fast.
Why a Heatmap
With many columns, reading correlations one pair at a time is painful. A heatmap shows every pairing at once as a grid of colors. 🔥
Start With corr
First build a correlation matrix. In pandas, calling corr on a numeric DataFrame returns a square table of every column paired with every other.
corr = df.corr(numeric_only=True)
print(corr.round(2))All lessons in this course
- Correlation Is Not Causation
- Pearson vs Spearman
- Read a Correlation Heatmap
- Skew, Kurtosis, and Normality