Lesson 4.4: Correlation Analysis
What is Correlation?
Correlation measures the strength and direction of the relationship between two variables. It tells us whether variables move together, opposite, or independently.
1. Types of Correlation
-
Positive Correlation (+1 close) → Both variables increase together.
-
Example: Height ↑, Weight ↑.
-
-
Negative Correlation (-1 close) → One variable increases, the other decreases.
-
Example: TV watching ↑, Study hours ↓.
-
-
Zero/No Correlation (≈0) → No relationship.
-
Example: Shoe size and intelligence.
-
2. Correlation Coefficient (r)
-
Value ranges from -1 to +1:
-
+1 → Perfect positive
-
-1 → Perfect negative
-
0 → No correlation
-
3. Correlation Matrix & Heatmap
-
Correlation Matrix: A table showing correlations between all variable pairs.
-
Heatmap: Visual representation of the correlation matrix (color-coded).
4. Why Correlation is Important?
-
Helps to identify relationships between features.
-
Useful in feature selection (removing highly correlated/redundant features).
-
Helps in predicting how one variable may affect another.
