Skip to content

Fix b-bit MinHash estimator correction#1

Closed
dipeshbabu wants to merge 1 commit into
masterfrom
agent/fix-b-bit-estimator
Closed

Fix b-bit MinHash estimator correction#1
dipeshbabu wants to merge 1 commit into
masterfrom
agent/fix-b-bit-estimator

Conversation

@dipeshbabu

Copy link
Copy Markdown
Owner

What

Correct the b-bit MinHash A(r, b) denominator to use the required 2^b exponent and add a focused regression test.

Why

The previous 2*b exponent produced a biased correction whenever b was greater than two and r was nonzero.

Impact

Jaccard estimates using a nonzero universe ratio now follow the published estimator. The r=0 behavior is unchanged.

Root cause

The exponentiation term was transcribed as multiplication.

Checks

  • uv run pytest -q test/test_minhash.py (18 passed)
  • uv run ruff check datasketch/b_bit_minhash.py test/test_minhash.py
  • git diff --check

@dipeshbabu
dipeshbabu marked this pull request as ready for review July 19, 2026 03:50
@dipeshbabu

Copy link
Copy Markdown
Owner Author

Superseded by upstream pull request ekzhu#325.

@dipeshbabu dipeshbabu closed this Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant