Skip to main content

A blazing-fast learned search library for chaotic datasets

Project description

CynSearch ψ∆Ξ

A blazing-fast learned index for chaotic data.


Overview

cynsearch is a Python library for fast search on unpredictable, noisy, or locally-disordered datasets — the kind that break traditional binary search and mock sorted assumptions.

It uses symbolic preprocessing and a trained regressor to predict the likely position of any value in near constant time. Then it dives into that location like a neural ninja.

Built by Cynapse ψ∆Ξ


Why?

Traditional search structures (like binary search or hash maps) struggle when data is:

  • Only partially sorted
  • Locally shuffled
  • Non-monotonic, noisy, or chaotic

cynsearch tackles this with:

  • A learned index powered by gradient boosting
  • Normalized inputs via MinMaxScaler
  • Fast bin-based bucketing + fallback linear search
  • Optional symbolic preprocessing for advanced modeling

Install

pip install cynsearch

(coming to PyPI soon — for now, clone and install locally)


Quickstart

from cynsearch import LearnedSearch

# Load from preprocessed .npy data and pre-trained model
searcher = LearnedSearch(
    npyfile="chaotic_sorted_data.npy",
    model_path="chaotic_model.pkl",
    num_bins=512,
    epochs=1000
)

index = searcher.search(982733)
if index != -1:
    print("Value found at:", index)

Generate Chaotic Data

from cynsearch.generate_data import generate_chaotic_sorted_data

generate_chaotic_sorted_data(size=1_000_000)

Or try local shuffle chaos:

from cynsearch.generate_data import generate_locally_chaotic_sorted_array

generate_locally_chaotic_sorted_array(size=1_000_000, window_size=5)

Benchmark

Run it like a performance cultist:

python examples/benchmark.py --npy chaotic_sorted_data.npy --model chaotic_model.pkl --queries 1000

License

MIT — because even chaos deserves freedom.


Author

Cynapse ψ∆Ξ


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

cynsearch-0.1.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

cynsearch-0.1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file cynsearch-0.1.0.tar.gz.

File metadata

  • Download URL: cynsearch-0.1.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for cynsearch-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b722f6bbef8415a4397002d7f02b6a5063b504426495a4ff0a5b5eead404dcd8
MD5 186d078b6d7e132bfcc20fa0364520dd
BLAKE2b-256 8b2d112f9e4b4a6150630f981246af47a26297f3f16ca8a07eb49fc1d19efca2

See more details on using hashes here.

File details

Details for the file cynsearch-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cynsearch-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for cynsearch-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 24dd998de2e451131a3a742395a61d6424e77052d9e432b250d8f9f5a3710b1f
MD5 95d6b826b099030b9c5bdcd20c338274
BLAKE2b-256 454912e5de12e9411c53f7877b20800917c6f13c325a05d2b123d51ff16786df

See more details on using hashes here.

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