Correlation and Covariance
Pearson/Spearman correlation, covariance matrix, interpreting correlation in ML context.
Measuring Relationships
Covariance and correlation quantify how two variables move together. They are the basis for feature selection, portfolio theory, and exploratory analysis.
Covariance
Covariance is positive when variables rise together, negative when one rises as the other falls. Its magnitude depends on units, making raw covariance hard to interpret.
import numpy as np
x = np.array([1, 2, 3, 4, 5])
y = np.array([2, 4, 5, 4, 6])
print(np.cov(x, y, ddof=1)) # 2x2 covariance matrixAll lessons in this course
- Descriptive Statistics and Distributions
- Probability and Bayes Theorem
- Hypothesis Testing
- Correlation and Covariance