Skip to main content
QUICK REVIEW

[Paper Review] A Guide to Similarity Measures

Avivit Levy, B. Riva Shalom|arXiv (Cornell University)|Aug 7, 2024
Time Series Analysis and ForecastingComputer Science3 citations
TL;DR

This guide provides a comprehensive, application-oriented overview of 50+ similarity and distance measures across numerical, categorical, and string data types. It classifies measures by family, explains their design principles and formulas, and offers practical guidance for selecting appropriate metrics in data science tasks such as clustering, classification, and information retrieval.

ABSTRACT

Similarity measures play a central role in various data science application domains for a wide assortment of tasks. This guide describes a comprehensive set of prevalent similarity measures to serve both non-experts and professional. Non-experts that wish to understand the motivation for a measure as well as how to use it may find a friendly and detailed exposition of the formulas of the measures, whereas experts may find a glance to the principles of designing similarity measures and ideas for a better way to measure similarity for their desired task in a given application domain.

Motivation & Objective

  • To address the lack of awareness among researchers about the full range of available similarity measures across diverse data science applications.
  • To bridge the gap between non-experts seeking intuitive understanding and experts needing principled design insights for custom similarity metrics.
  • To provide a refined, application-focused classification of similarity measures beyond narrow domain-specific surveys.
  • To highlight underutilized yet powerful metrics like Mahalanobis distance and N-gram based measures in practical data science workflows.
  • To support better decision-making in similarity measurement by clarifying trade-offs and properties such as metric validity, symmetry, and interpretability.

Proposed method

  • Classifies similarity measures into 9 families: Inner Product, Minkowski, Intersection, Entropy, Chi-Square, Fidelity, String, and N-gram based measures.
  • Presents each measure with its mathematical formula, intuitive explanation of design purpose, and a concrete example for clarity.
  • Applies measures to diverse data types: numerical vectors, categorical data, and strings via N-gram transformation.
  • Uses N-gram sets to compute Jaccard and Cosine similarity/distance on strings, transforming sequences into sets of substrings.
  • Evaluates N-gram similarity using intersection and union of N-gram sets, and vector-based cosine similarity on frequency vectors.
  • Highlights properties such as metric compliance (identity, symmetry, triangle inequality) and notes where common measures fail to satisfy them.

Experimental results

Research questions

  • RQ1Which similarity measures are most effective for different data types (numerical, categorical, textual) in real-world data science applications?
  • RQ2How can researchers systematically choose between competing similarity measures for a given task, such as clustering or anomaly detection?
  • RQ3What are the design principles behind effective similarity measures, and how can they be adapted to specific application domains?
  • RQ4Why are some powerful metrics like Mahalanobis distance underused in machine learning despite their strong theoretical foundation?
  • RQ5How do N-gram based similarity measures compare in performance and interpretability to traditional string metrics like Levenshtein or Jaro-Winkler?

Key findings

  • The Mahalanobis distance is highly effective for multivariate anomaly detection and one-class classification but remains underused in practice.
  • N-gram based Jaccard and Cosine similarity measures provide robust string comparison, with Jaccard similarity on 2-grams yielding 0.4286 and Cosine similarity 0.7746 for the given example.
  • The N-gram distance is not a metric because it violates the identity axiom and triangle inequality, as shown in the example with 7 total 2-grams and 3 shared.
  • Cosine similarity on N-gram frequency vectors captures angular similarity and achieved a score of 0.7746 in the example, indicating strong vector alignment.
  • String similarity measures like Levenshtein and Jaro-Winkler are effective for edit-distance tasks but are not suitable for set-based or frequency-based comparisons.
  • The guide identifies that many widely used measures—such as Euclidean distance in compressed image retrieval—may underperform compared to alternatives like Canberra or Wave-Hedges metrics.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.