Correlation and Heatmaps
This lesson will introduce how to calculate and visualize correlations between quantities in python.
We'll cover the following
Correlation
Correlation is a mathematical technique that shows how strongly two variables are linked. It quantifies the strength of the relationship. For instance, we know that the weight and height of a person are correlated. Taller people tend to have more weight. Hence, we say that height and weight are correlated.
Correlation is measured in terms of a number called correlation coefficient, which ranges from to . The value of or denotes complete correlation, while indicates that no correlation is present between the two variables. Negative values mean there is an inverse relationship between the two variables, while a positive value denotes a direct relationship.
Pandas has the function corr
that can be called on a dataframe. Let’s see an example of this on our Default of Credit Card Clients Dataset.
Get hands-on with 1400+ tech skills courses.