Skip to main content

jaccard.py Stars

Utilities related to Jaccard/Tanimoto coefficients.

Actions Coverage License PyPI Bioconda Wheel Python Versions Python Implementations Source GitHub issues Docs Changelog Downloads

🗺️ Overview

jaccard.py is a pure-Python package providing Jaccard index computation.

This library only depends on NumPy and is available for all modern Python versions (3.6+).

📋 Features

Agnostic interface using duck-typing: all functions should be available for NumPy arrays, MLX arrays, or PyTorch tensors, unless noted otherwise.

The following functions are implemented:

  • Jaccard similarity[1]: measure similarity between boolean vectors, similar to scipy.spatial.distance.jaccard.
  • probabilistic Jaccard similarity[2]: measure similarity between probability vectors while quantifying uncertainty.
  • centered Jaccard similarity and Jaccard testing[3]: identify non-random co-occurences between samples with robust statistical testing.
  • collision probability Jaccard index [4]: measure similarity between positive indices, using a metric that is scale invariant, sensitive to changes in support, and computable as a collision probability.

🔧 Installing

Install the jaccard package directly from PyPi which hosts universal wheels that can be installed with pip:

$ pip install jaccard

💭 Feedback

⚠️ Issue Tracker

Found a bug ? Have an enhancement request ? Head over to the GitHub issue tracker if you need to report or ask something. If you are filing in on a bug, please include as much information as you can about the issue, and try to recreate the same bug in a simple, easily reproducible situation.

🏗️ Contributing

Contributions are more than welcome! See CONTRIBUTING.md for more details.

⚖️ License

This library is provided under the MIT License.

This project was developed by Martin Larralde during his PhD project at the Leiden University Medical Center in the Zeller team.

📚 References

  • [1] Jaccard, P. "Étude comparative de la distribution florale dans une portion des Alpes et du Jura." Bulletin de la Société Vaudoise des Sciences Naturelles 37, 547–579 (1901). doi:10.1111/j.1469-8137.1912.tb05611.x
  • [2] Martire, I., Da Silva, P. N., Plastino, A., Fabris, F. & Freitas, A. A. "A novel probabilistic Jaccard distance measure for classification of sparse and uncertain data". Proceedings of the 5th Symposium on Knowledge Discovery, Mining and Learning, 81-88 (2017).
  • [3] Chung, N. C., Miasojedow, B., Startek, M. & Gambin, A. "Jaccard/Tanimoto similarity test and estimation methods for biological presence-absence data". BMC Bioinformatics 20, 644 (2019). doi:10.1186/s12859-019-3118-5
  • [4] 1. Moulton, R. & Jiang, Y. "Maximally Consistent Sampling and the Jaccard Index of Probability Distributions". in 2018 IEEE International Conference on Data Mining (ICDM) 347–356 (2018). doi:10.1109/ICDM.2018.00050.

Metadata

Release files for jaccard 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 jaccard 0.1.0
File Size Uploaded
jaccard-0.1.0.tar.gz 10.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jaccard 0.1.0
File Interpreter ABI Platform
jaccard-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.3 kB

Release files / jaccard-0.1.0.tar.gz

Download URL jaccard-0.1.0.tar.gz
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
cd4f8fc4f33de6553805cb23a39a0c946a3f406260e77dad5cda37611c1f9e03
BLAKE2b-256 checksum
How to use checksums
bc15be43e4925ce47b3a6843f8a290807bf560ed3d2202459288afc1a07c00df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 10, 2026.

Transparency log

Release files / jaccard-0.1.0-py3-none-any.whl

Download URL jaccard-0.1.0-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b3d6d073fb78badeda847e4e77c01ed034480c5f478956e4b8c1fb75fd8bb798
BLAKE2b-256 checksum
How to use checksums
1af53385c47ab4bacd2969ed138853fc60b8ae88318b0f23340fd912cf40d4dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 10, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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