Skip to main content

pyDML

Distance Metric Learning Algorithms for Python

What is Distance Metric Learning?

Many machine learning algorithms need a similarity measure to carry out their tasks. Usually, standard distances, like euclidean distance, are used to measure this similarity. Distance Metric Learning algorithms try to learn an optimal distance from the data.

How to learn a distance?

There are two main ways to learn a distance in Distance Metric Learning:

  • Learning a metric matrix M, that is, a positive semidefinite matrix. In this case, the distance is measured as

  • Learning a linear map L. This map is also represented by a matrix, not necessarily definite or squared. Here, the distance between two elements is the euclidean distance after applying the transformation.

Every linear map defines a single metric (M = L'L), and two linear maps that define the same metric only differ in an isometry. So both approaches are equivalent.

Some applications

Improve distance based classifiers

Improving 1-NN classification.

Dimensionality reduction

Learning a projection onto a plane for the digits dataset (dimension 64).

Documentation

See the available algorithms, the additional functionalities and the full documentation here.

Stats

The distance metric learning algorithms in pyDML are being evaluated in several datasets. The results of these experiments are available in the pyDML-Stats repository.

Installation

  • PyPI latest version: pip install pyDML

  • From GitHub: clone or download this repository and run the command python setup.py install on the root directory.

Authors

Metadata

Release files for pyDML 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyDML 0.1.0
File Size Uploaded Provenance
pyDML-0.1.0.tar.gz 54.8 kB Without provenance Details

Release files / pyDML-0.1.0.tar.gz

Download URL pyDML-0.1.0.tar.gz
Size 54.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8ee8af712fa2f3bc5d37494e84888af530fc5af37f48285f74003c4d6fc9ae6e
BLAKE2b-256 checksum
How to use checksums
96202903ed13f1f5504ce35d6eb1abf0f7dd282d09d350c76f5342de55f339a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

Security for pyDML 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page