Skip to main content

Python module of less-common metrics.

Project description

Metrics

Python implementation of some more uncommon metrics. Currently only longest common subsequence LCS metrics are implemented.

Dependencies

This package requires the following python libraries:

  1. numpy (automatically installed when package is installed via pip)

Installation

The metrics package can be installed directly from pip.

pip3 install metrics

Metrics

The metrics library currently has support for the following modules.

  1. Longest common subsequence metrics distance_metrics.lcs

Longest common subsequence metrics

The LCS module currently implements 2 distances:

  1. Length of longest common subsequence (distance_metrics.lcs.llcs(u, v)).
  2. Bakkelund distance [1] (metrics.lcs.bakkelund(u, v))

Usage

# Imports
from distance_metrics import lcs
import numpy as np

# Create example input arrays
u = np.random.choice(list('ABCD'), size=20)
v = np.random.choice(list('BCDE'), size=20)

# Compute metrics
llcs      = lcs.llcs(u, v)
bakkelund = lcs.bakkelund(u, v)

# Print values
print("LLCS     : {}".format(llcs))
print("Bakkelund: {}".format(bakkelund))
References
1 Bakkelund, D. (2009). An LCS-based string metric. Olso, Norway: University of Oslo.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

distance-metrics-0.0.1.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

distance_metrics-0.0.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file distance-metrics-0.0.1.tar.gz.

File metadata

  • Download URL: distance-metrics-0.0.1.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5

File hashes

Hashes for distance-metrics-0.0.1.tar.gz
Algorithm Hash digest
SHA256 9eabfd31576b4484b51038ae986d0babb83ff80ffb6616385d40ebe23032c974
MD5 3f4b937679ae47614daac29db4d62ba4
BLAKE2b-256 74a342f28754ccc2e61fa86cebfa80e75c8487b69360e8de022ba97002af48c2

See more details on using hashes here.

File details

Details for the file distance_metrics-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: distance_metrics-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5

File hashes

Hashes for distance_metrics-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 646ff7f296915c0aa67c393161488f73126678ec77badeb1836a9f59f033ebbb
MD5 ab9ae99a7ae0f56a4c9bf63ff1dae1bc
BLAKE2b-256 2b99bb2faf57cc632e7752a044d1434ea5b308ec378eea1ee127ba8294a93513

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page