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.

jaccard_similarity

Computes the Jaccard similarity of two arbitrary iterables.

from fog.metrics import jaccard_similarity

# Basic
jaccard_similarity('context', 'contact')
>>> ~0.571

Arguments

  • A iterable: first sequence to compare.
  • B iterable: second sequence to compare.

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.5.4.tar.gz (64.4 kB view details)

Uploaded Source

Built Distributions

fog-0.5.4-py3.7-macosx-10.13-x86_64.egg (168.7 kB view details)

Uploaded Source

fog-0.5.4-cp37-cp37m-macosx_10_13_x86_64.whl (70.9 kB view details)

Uploaded CPython 3.7m macOS 10.13+ x86-64

File details

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

File metadata

  • Download URL: fog-0.5.4.tar.gz
  • Upload date:
  • Size: 64.4 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.23.4 CPython/3.7.0

File hashes

Hashes for fog-0.5.4.tar.gz
Algorithm Hash digest
SHA256 bcdf76f56b25f43865c472295be609c30332518d39d1419abe26c1ed4be34f0f
MD5 da2639f569c66063f068a7024eb1edfa
BLAKE2b-256 83467bd01cf2778aa49e680b42dd32abc8f5496e7d67ebba769eb58c73729348

See more details on using hashes here.

File details

Details for the file fog-0.5.4-py3.7-macosx-10.13-x86_64.egg.

File metadata

  • Download URL: fog-0.5.4-py3.7-macosx-10.13-x86_64.egg
  • Upload date:
  • Size: 168.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0

File hashes

Hashes for fog-0.5.4-py3.7-macosx-10.13-x86_64.egg
Algorithm Hash digest
SHA256 7b9eb152740f85406a6f463168ed0260a7ebdca028b16b13b6508710a1c16532
MD5 ad12a5cfb5faa07b434af686d21bf253
BLAKE2b-256 8c542a797a6aeb84154b00992381f4f0ba0fd2f8b4ae3cf99eaae750ee523609

See more details on using hashes here.

File details

Details for the file fog-0.5.4-cp37-cp37m-macosx_10_13_x86_64.whl.

File metadata

  • Download URL: fog-0.5.4-cp37-cp37m-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 70.9 kB
  • Tags: CPython 3.7m, macOS 10.13+ x86-64
  • 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.23.4 CPython/3.7.0

File hashes

Hashes for fog-0.5.4-cp37-cp37m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 ca3ca86621402804107d05adbd4db1d6f1a11d593883ce146df7b44f05bc713c
MD5 20663a6ab59a8d054157be3c49d82018
BLAKE2b-256 674fba7e9b942f080a649941ddde041e24e3bc5efd094f851f759ebbf5565aa2

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