Skip to main content

KSU Compression Algorithm Implementation

Algortihm 1 from Nearest-Neighbor Sample Compression: Efficiency, Consistency, Infinite Dimensions

Installation

  • With pip: pip install ksu
  • From source:
    • git clone --recursive https://github.com/nimroha/ksu_classifier.git
    • cd ksu_classifier
    • python setup.py install

Usage

This package provides a class KSU(Xs, Ys, metric, [gramPath, prune])

Xs and Ys are the data points and their respective labels as numpy arrays

metric is either a callable to compute the metric or a string that names one of our provided metrics (print ksu.KSU.METRICS.keys() for the full list)

gramPath (optional, default=None) a path to a precomputed gramian matrix

prune (optional, default=False) a boolean indicating whether to prune the compressed set or not (Algorithm 2 from Near-optimal sample compression for nearest neighbors)


KSU provides a method makePredictor([delta])

Which returns a 1-NN Classifer (based on sklearn's K-NN) fitted to the compressed data, where delta (optional, default=5%) is the required confidence of said classifier.

Metadata

Release files for ksu 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 ksu 0.1.2
File Size Uploaded
ksu-0.1.2.tar.gz 8.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ksu 0.1.2
File Interpreter ABI Platform
ksu-0.1.2-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 17.0 kB

Release files / ksu-0.1.2.tar.gz

Download URL ksu-0.1.2.tar.gz
Size 8.4 kB
Tags Source
SHA-256 checksum
How to use checksums
84005a8f3b99f44fbdae3024d9dd8b0b09b62c95e5b8e47ea41a44740d0aecb4
BLAKE2b-256 checksum
How to use checksums
0df73203dba85d8607fce5817d0ebe21958242fcf8263aeedc54609860ebbf09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / ksu-0.1.2-py2.py3-none-any.whl

Download URL ksu-0.1.2-py2.py3-none-any.whl
Size 8.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
bc1aa2ffc26d6d5239dea09827a400d7aac6deffa08764e54263fb4213ead42a
BLAKE2b-256 checksum
How to use checksums
d74cd3b0d22f61382bdb71703c174d27f9b960e9987085c777d883cbfeb9234f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

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