Menu

Creating a Correlation Matrix

Creating a Correlation Matrix

A correlation matrix calculates pairwise relationships between all variables in the dataset.

Code

**correlation = house_price_df.corr()**

Explanation

The resulting matrix shows:

  • How strongly variables are related
  • Which features move together
  • Which variables influence the target variable

This is one of the most useful tools in exploratory data analysis.