Skip to main content

A lightweight, high-performance sequence classifier using recursive suffix smoothing.

Project description

Suffix Smoother Library

A lightweight, high-performance sequence classifier using recursive suffix smoothing. This library is domain-agnostic and excels at problems where sequence suffixes are strong predictors of class labels.

Features

  • Robust OOV Handling: Gracefully falls back to shorter suffixes (n-grams) when an exact match isn't found.
  • Blazing Fast: Constant time lookup O(k) where k is max suffix length.
  • Zero-Dependency Core: Only requires `numpy`.
  • Interpretable: Provides confidence and entropy-based uncertainty metrics.

Installation

```bash pip install . ```

Quick Start

```python from suffix_smoother import SuffixSmoother, SuffixConfig

Configure: max suffix 5, 2 classes (Normal, Anomaly)

config = SuffixConfig(max_suffix_length=5, n_classes=2) smoother = SuffixSmoother(config)

Training data: (context_tuple, label_id)

training = [ ((101, 102, 103), 0), ((404, 404, 500), 1), ] smoother.train(training)

Predict

label, confidence = smoother.predict((101, 102, 103)) print(f"Label: {label}, Confidence: {confidence:.2f}") ```

Real-World Performance

See BENCHMARKS.md for details on NLP (81% accuracy) and Genomics (69% recall) validation.

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

suffix_smoother-0.1.0.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

suffix_smoother-0.1.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: suffix_smoother-0.1.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for suffix_smoother-0.1.0.tar.gz
Algorithm Hash digest
SHA256 61e200e61d30633431baa9aa9931f9eda72cc3404ced9c8d5a09dd04cb3746bc
MD5 ab531657ba579f4000d5682282b90cee
BLAKE2b-256 a20284ea3167db1f60d9f39b1c936bc7fbdf1cf4cc96754273560bd8f8f9f590

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for suffix_smoother-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 032ccbb2b7bc1668421f795435659415df0cdb018163f3c4a7fb952debccfde9
MD5 b1ce7d656a0ef0cc3d3a1b9782bf9131
BLAKE2b-256 32384b784d2cd1c5971368a049af87f16848d332e75117d31e482745a2cd0542

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