Generating a heat map based on a correlation matrix
The correlation between two variables is a measure of how much they move together. A correlation of 1 means that the two variables are perfectly positively correlated. As one variable increases in size, so does the other. A value of -1 means that they are perfectly negatively correlated. As one variable increases in size, the other decreases. Correlations of 1 or -1 only rarely happen, but correlations above 0.5 or below -0.5 might still be meaningful. There are several tests that can tell us whether the relationship is statistically significant (such as Pearson, Spearman, and Kendall). Since this is a chapter on visualizations, we will focus on viewing important correlations.
Getting ready
You will need Matplotlib and Seaborn installed to run the code in this recipe. Both can be installed by using pip
, with the pip install matplotlib
and pip install seaborn
commands.
How to do it…
We first show part of a correlation...