Skip to main content

Density Yields Features - Rust core for structure discovery in embedding spaces

Project description

DYF-RS - Density Yields Features (Rust Core)

Rust-accelerated core for DYF. Discover structure in embedding spaces using density-based LSH.

  • Dense: Core items in well-populated semantic regions
  • Bridge: Transitional items connecting different clusters
  • Orphan: Unique items with no semantic neighbors

Installation

pip install dyf-rs

For the full Python package with serialization, embedding generation, and LLM labeling:

pip install dyf

Quick Start

import numpy as np
from dyf_rs import DensityClassifier

# Your embeddings (e.g., from sentence-transformers)
embeddings = np.random.randn(10000, 384).astype(np.float32)

# Find structure
classifier = DensityClassifier(embedding_dim=384)
classifier.fit(embeddings)

# What did we find?
print(classifier.report())
# Corpus: 10000 items
#   Dense: 9500 (95.0%)
#   Bridge: 450 (4.5%)
#   Orphan: 50 (0.5%)

# Get indices
bridges = classifier.get_bridge()  # Transitional items
orphans = classifier.get_orphans() # Unique items

Performance

Dataset Time Per item
60K embeddings (384d) ~60ms 1.0 µs

~4x faster than pure Python/sklearn.

API

DensityClassifier

DensityClassifier(
    embedding_dim: int,
    initial_bits: int = 14,      # LSH resolution
    recovery_bits: int = 8,      # Coarser recovery resolution
    dense_threshold: int = 10,   # Min bucket size for "dense"
    seed: int = 31
)

# Methods
classifier.fit(embeddings)
classifier.fit_arrow(arrow_array)  # Zero-copy from PyArrow
classifier.get_dense()             # Dense item indices
classifier.get_bridge()            # Bridge item indices
classifier.get_orphans()           # Orphan item indices
classifier.get_bucket_id(idx)      # Which bucket is item in?
classifier.report()                # Summary statistics

See Also

  • dyf - Full Python package with serialization, configs, and LLM labeling
  • Curvo FDA Navigator - DYF in action on 2.69M FDA medical devices

License

Proprietary

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

dyf_rs-0.6.0.tar.gz (2.3 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

dyf_rs-0.6.0-cp312-cp312-macosx_11_0_arm64.whl (835.2 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

dyf_rs-0.6.0-cp311-cp311-win_amd64.whl (865.5 kB view details)

Uploaded CPython 3.11Windows x86-64

dyf_rs-0.6.0-cp311-cp311-manylinux_2_28_x86_64.whl (13.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

dyf_rs-0.6.0-cp311-cp311-manylinux_2_28_aarch64.whl (6.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

dyf_rs-0.6.0-cp311-cp311-macosx_11_0_arm64.whl (964.4 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

dyf_rs-0.6.0-cp311-cp311-macosx_10_12_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

File details

Details for the file dyf_rs-0.6.0.tar.gz.

File metadata

  • Download URL: dyf_rs-0.6.0.tar.gz
  • Upload date:
  • Size: 2.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.12.6

File hashes

Hashes for dyf_rs-0.6.0.tar.gz
Algorithm Hash digest
SHA256 b051999d6f6dc327a345a6080adc7d909bb0afdc2da593ed3aa7eea7e4920230
MD5 a62163cebca86fe23ae4b50ddb456d08
BLAKE2b-256 4fbc232435b1e6b98a1acdc502e47eb7e455bf6c99dbb903d528bb86f970eaa4

See more details on using hashes here.

File details

Details for the file dyf_rs-0.6.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dyf_rs-0.6.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8d8258d389d47a194da97f0f81555dbc8fdcdde8e7df098218b475073d482ce2
MD5 0ec216ee49605504d2c003abb58f6524
BLAKE2b-256 81cd543224afc9bbc55e9904c99fbbad49a1642ee3ff0d81740d9bec6949039f

See more details on using hashes here.

File details

Details for the file dyf_rs-0.6.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: dyf_rs-0.6.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 865.5 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dyf_rs-0.6.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 fa09ad70a402e92bf01961390857b573aa2eb12ff227029ca9c291284b46c4a8
MD5 147ebf685e480867200d612418070b67
BLAKE2b-256 82ab98cda0b3ebb8ced62a8af134ba450dcde9bda9c909ea2d8d3c71e7923de6

See more details on using hashes here.

Provenance

The following attestation bundles were made for dyf_rs-0.6.0-cp311-cp311-win_amd64.whl:

Publisher: build-wheels.yml on jdonaldson/dyf-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dyf_rs-0.6.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dyf_rs-0.6.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d1dac8f7783990d86a7775264d4b3e3ba668244a822b74c1239313348ce27fc6
MD5 d14913179e900bc202f843325e3f3fcd
BLAKE2b-256 d67de0f6ff889aaf9b9904c0d0631e2da775452cdd0fa6e65512c41af0352f85

See more details on using hashes here.

Provenance

The following attestation bundles were made for dyf_rs-0.6.0-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: build-wheels.yml on jdonaldson/dyf-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dyf_rs-0.6.0-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for dyf_rs-0.6.0-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 42e2501f2592aded7ab907d895539f193c3daca77ed8d83026aaef01cdd50590
MD5 0f8d93cafcb0e23199a32a2cf68a8579
BLAKE2b-256 8e04658712da3859e3ada51a3cd8c4466bd7144a014a859c03fe5c8c2670ab8d

See more details on using hashes here.

Provenance

The following attestation bundles were made for dyf_rs-0.6.0-cp311-cp311-manylinux_2_28_aarch64.whl:

Publisher: build-wheels.yml on jdonaldson/dyf-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dyf_rs-0.6.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dyf_rs-0.6.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7f823bb099c429b0afc4e73aa4c79af4708e17b204b6579ae8ed308a413fb2bc
MD5 0f377c0cdfc77799823f20158cfe7486
BLAKE2b-256 d7c6dd52e221b8a7ac2af4965c57bcb45f832122da52a402774708b7673312c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for dyf_rs-0.6.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: build-wheels.yml on jdonaldson/dyf-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dyf_rs-0.6.0-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for dyf_rs-0.6.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7e6b63ec5d0d3c36b41c0607f19ff47881b1d3650d8fb8c857b823712f130c06
MD5 64ea05fedb647b1fe11bb0dd44cd5bb8
BLAKE2b-256 4a8ab7d2775fa6cbdf8e43ef8ccc45dccfcb838c9200487f66abc41c1840fcc1

See more details on using hashes here.

Provenance

The following attestation bundles were made for dyf_rs-0.6.0-cp311-cp311-macosx_10_12_x86_64.whl:

Publisher: build-wheels.yml on jdonaldson/dyf-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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