Skip to content

Add USearch as Jaccard backend, update README and noteboooks#20

Merged
afloresep merged 10 commits intomasterfrom
layout_generators
Mar 29, 2026
Merged

Add USearch as Jaccard backend, update README and noteboooks#20
afloresep merged 10 commits intomasterfrom
layout_generators

Conversation

@afloresep
Copy link
Copy Markdown
Owner

Add USearch as Jaccard backend, update README and noteboooks

USearchIndex.build_from_binary() builds an HNSW index using native
bit-vector Jaccard distance (b1x8 dtype). No MinHash encoding needed.

Estimator auto-selects backend based on input type:
- Dense binary matrix (ndarray/DataFrame) → USearch Jaccard
- Sparse matrix (scipy CSR) → MinHash+LSH (avoids densification OOM)
- Sets/strings → MinHash+LSH (variable-length data)

Also switches transform/add_points to batch queries (was per-point loop).

Validation: 0/1 enforcement on build, add, and query; width checks on
query; eager failure on load when binary vectors sidecar is missing.
- 13 new USearchIndex binary tests: build, kNN contract, query, add,
  validation (non-0/1 rejection, wrong width), persistence, pickle
- Update estimator tests for USearch routing: relax tie-order assertions,
  verify sparse CSR stays on LSH path, use set input for MinHash seed test
- docs/usearch_backend.md: how it works, when it's used, performance
  tables (recall, build time, query time, memory), tuning guide
- notebooks/06_metric_guide.ipynb: update summary table for USearch routing
- notebooks/12_usearch_jaccard.ipynb: standalone USearch usage + estimator
- README: update pipeline diagram, add USearchIndex standalone examples
- api_reference: add kneighbors(), update property docs for index_/lsh_forest_
- notebook 11: kernel metadata update
- Ruff check
Removed unused images from the README.
@afloresep afloresep merged commit 6597255 into master Mar 29, 2026
6 checks passed
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