Skip to main content

HammingEncoder

HammingEncoder is the source code for paper.

Installation

You can install HammingEncoder from PyPI:

pip install HammingEncoder

Usage

Here's how to use the HammingEncoder package:

Importing the package

from HammingEncoder import HammingEncoder

# Example data
sequences = [
    ['0', '1', '2', '3', '4', '5', '1', '6', '5', '1', '7', '4', '5', '8', '5'], 
    ['0', '1', '4', '2', '3', '4', '5', '8', '5', '1', '7', '4', '5', '1', '5', '1', '5', '6', '5'],
    ['0', '1', '2', '3', '4', '5', '8', '5', '1', '5', '7', '5', '1', '8', '5', '1', '5', '1', '5', '1', '6', '4', '5'], 
    ['0', '4', '2', '3', '5', '7', '5', '1', '5', '4', '6', '5', '1', '5', '4', '5'],
    ]
labels = [0, 1, 0, 1]

# Initialize the encoder
encoder = HammingEncoder(sequences, labels, gap_constrain=5, label_number=2, Preset_set_pattern_num=1024, device='cpu')

# Fit the model
encoder.fit(n_epochs=100, patience=2, batch_size=64)

# Transform the data
encoded_data = encoder.transform(sequences)

print("Encoded data:", encoded_data)

# test
acc = encoder.test(sequences, labels)
print("Accuracy:", acc)

Release files for HammingEncoder 0.1.8

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

Source distribution (sdist)

Source distribution for HammingEncoder 0.1.8
File Size Uploaded
hammingencoder-0.1.8.tar.gz 6.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for HammingEncoder 0.1.8
File Interpreter ABI Platform
HammingEncoder-0.1.8-py3-none-any.whl Python 3 none any Details

Total release size: 14.9 kB

Release files / hammingencoder-0.1.8.tar.gz

Download URL hammingencoder-0.1.8.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d08fd2e29ac607731de4294a27aee66be4c126bc4c448733795f423f61c47b02
BLAKE2b-256 checksum
How to use checksums
feaebca6b4da8092a2dc59ae7b5d67319aae28a044346a8d7f29ad08b0c4760b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.3

Release files / HammingEncoder-0.1.8-py3-none-any.whl

Download URL HammingEncoder-0.1.8-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
023eed049abee5ece2da40bf6dbfa8ff08056065b78cb9a3355225ac81162b4d
BLAKE2b-256 checksum
How to use checksums
6a816d1bed8a74bd410604adf449a7d66bf354875573308aeda255330f691fec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.1.8 This release

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

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