math analysis geometry

Definition

Metric

A metric (or distance function) on a set is a function that satisfies the following axioms for all :

  1. Non-negativity:
  2. Identity of Indiscernibles:
  3. Symmetry:
  4. Triangle Inequality:

A set equipped with a metric is called a metric space.

Applications in Machine Learning

The choice of metric determines the “closeness” of instances in the instance space. It is the fundamental component of distance-based learning algorithms (e.g., kNN, k-Means), where predictions are derived from the geometric proximity of data points.