Skip to main content

k nearest neighbor (KNN) graphs via Pearson correlation distance and local sensitive hashing (LSH).

import numpy as np
import lshknn

# Make mock data
# 2 features (rows), 4 samples (columns)
data = np.array(
        [[1, 0, 1, 0],
         [0, 1, 0, 1]],
        dtype=np.float64)

# Instantiate class
c = lshknn.Lshknn(
        data=data,
        k=1,
        threshold=0.2,
        m=10,
        slice_length=4)

# Call subroutine
knn, similarity, n_neighbors = c()

# Check result
assert (knn == [[2], [3], [0], [1]]).all()

Metadata

Release files for lshknn 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lshknn 0.1.2
File Size Uploaded Provenance Actions
lshknn-0.1.2.tar.gz 9.6 kB Without provenance Details for lshknn-0.1.2.tar.gz

Release files / lshknn-0.1.2.tar.gz

Download URL lshknn-0.1.2.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1a96208c0b43ce8f818d48bf02cb4c46549910001ba0f1122db9b5f71dd01f3e
BLAKE2b-256 checksum
How to use checksums
dbd1bf6b93f62eeaafb33fcb0edcf802b35f30e60dd616c0c24e7c656ce113fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for lshknn 0.1.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.2 This release

1 release file No provenance

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