Skip to main content

A fuzzy matching & clustering library for python.

Project description

Build Status

Fog

A fuzzy matching/clustering library for Python.

Installation

You can install fog with pip with the following command:

pip install fog

Usage

Metrics

sparse_cosine_similarity

Computes the cosine similarity of two sparse weighted sets. Those sets have to be represented as counters.

from fog.metrics import sparse_cosine_similarity

# Basic
sparse_cosine_similarity({'apple': 34, 'pear': 3}, {'pear': 1, 'orange': 1})
>>> ~0.062

Arguments

  • A Counter: first weighted set. Must be a dictionary mapping keys to weights.
  • B Counter: second weighted set. Muset be a dictionary mapping keys to weights.

weighted_jaccard_similarity

Computes the weighted Jaccard similarity of two weighted sets. Those sets have to be represented as counters.

from fog.metrics import weighted_jaccard_similarity

# Basic
weighted_jaccard_similarity({'apple': 34, 'pear': 3}, {'pear': 1, 'orange': 1})
>>> ~0.026

Arguments

  • A Counter: first weighted set. Must be a dictionary mapping keys to weights.
  • B Counter: second weighted set. Muset be a dictionary mapping keys to weights.

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

fog-0.2.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

fog-0.2.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file fog-0.2.0.tar.gz.

File metadata

  • Download URL: fog-0.2.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for fog-0.2.0.tar.gz
Algorithm Hash digest
SHA256 364692c4433afbe1fc76b28bfc1f1657aed015ba37f7ecc6072a8d2015c171bd
MD5 c78731319345935d9af1ff69aeb29a89
BLAKE2b-256 8d588b3b1d8ac22e1791c44e9700acb8e2ba87c152f6195e7454811655891413

See more details on using hashes here.

File details

Details for the file fog-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fog-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2800db5a789486abf6dbfc86afba1130be09b74b102f64cb754a340bbd94621e
MD5 1abbfa50c82536be3ec26dc9d8c8539a
BLAKE2b-256 f2343d583b144c6d111202d5200522a16ea22dab7b7bf23d16483a7f9417ff80

See more details on using hashes here.

Supported by

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