Explores the key differences between Pearson correlation and cosine similarity, two statistical measures for quantifying relationships between variables. While both are based on dot products, correlation performs double normalization (mean-centering and variance scaling) while cosine similarity only normalizes by magnitude.
Table of contents
The dot productPearson correlation: The doubly-normalized dot productCosine similarityCode simulations to build understandingSystematic comparison of correlation and cosine similarityWhen to use which?Sort: