Enterprise DNA
O Open Source Observability medium

metric-learn

by Community

Metric learning algorithms in Python

M

OSS

metric-learn

Added 1 June 2026

#machine-learning #metric-learning #python #scikit-learn

Overview

metric-learn is a Python library that provides algorithms for metric learning, enabling models to learn distance functions from data. It integrates with scikit-learn and offers methods like LMNN, NCA, and ITML for tasks such as dimensionality reduction and similarity learning.

Best for

Best for
Data scientists and ML engineers needing custom distance metrics for classification or retrieval.

Use cases

  • Improve nearest neighbor classification by learning a custom distance metric
  • Reduce feature space dimensionality while preserving pairwise relationships
  • Build similarity-based retrieval systems for images or text

Notes

metric-learn is a Python library that provides algorithms for metric learning, enabling models to learn distance functions from data. It integrates with scikit-learn and offers methods like LMNN, NCA, and ITML for tasks such as dimensionality reduction and similarity learning.

1,433 stars on GitHub. Last updated 2026-03-19. Licensed MIT.

Use cases

  • Improve nearest neighbor classification by learning a custom distance metric
  • Reduce feature space dimensionality while preserving pairwise relationships
  • Build similarity-based retrieval systems for images or text

Pros

  • Seamless integration with scikit-learn pipelines and estimators
  • Wide selection of well-documented metric learning algorithms
  • Active community with 1400+ GitHub stars and ongoing maintenance

Cons

  • Limited to metric learning tasks, not a general-purpose ML library
  • Performance can degrade on very high-dimensional or large-scale datasets
  • Documentation assumes familiarity with metric learning concepts

Indexed from awesome-llmops and enriched against its public facts.

Pros

  • Seamless integration with scikit-learn pipelines and estimators
  • Wide selection of well-documented metric learning algorithms
  • Active community with 1400+ GitHub stars and ongoing maintenance

Cons

  • Limited to metric learning tasks, not a general-purpose ML library
  • Performance can degrade on very high-dimensional or large-scale datasets
  • Documentation assumes familiarity with metric learning concepts

Pairs with

Other entries in the index that connect to this one. Click through to see the chain.