Variable Relationships › Correlation: Standardized Relationship Strength
Machine Learning from ScratchAll chapters Variable Relationships › Correlation: Standardized Relationship StrengthOne section · Sections in this chapter4 / 11 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
Correlation addresses the scale-dependence problem of covariance by standardizing the measure. The Pearson correlation coefficient, the most commonly used correlation measure, divides the covariance by the product of the standard deviations of both variables. This normalization ensures that correlation always falls between -1 and +1, regardless of the original units.
The population correlation coefficient is:
Where:
- : Standard deviation of
- : Standard deviation of
The sample correlation coefficient is:
Correlation values have clear interpretations. A correlation of indicates a perfect positive linear relationship where all points fall exactly on a line with positive slope. A correlation of indicates a perfect negative linear relationship. A correlation of suggests no linear relationship, though non-linear relationships may still exist. In practice, correlations between 0.7 and 1.0 or -0.7 and -1.0 are generally considered strong, 0.3 to 0.7 (or -0.3 to -0.7) moderate, and below 0.3 weak, though these thresholds vary by field and context.
The following visualization demonstrates these different correlation patterns, showing how various relationships between variables manifest in scatter plots and their corresponding correlation coefficients.



Correlation measures only linear relationships. Two variables can have zero correlation yet still be strongly related through a non-linear pattern such as a quadratic or sinusoidal relationship. This limitation makes visualization essential: plotting your data before relying solely on correlation coefficients helps identify non-linear patterns that correlation cannot detect. The following example demonstrates this limitation with a quadratic relationship where the correlation coefficient is near zero despite a clear pattern.
