Skip to main content

Simple class for fast one hot encoding. Support scikit-learn transformer interface and multithreading.

Project description

Fast One Hot Encoder

This is simple package for fast one hot encoding, implemented in Rust.

Installation

pip install rs_fast_one_hot --upgrade

Usage

from rs_fast_one_hot import OneHotTransformer

data = ['1a', '1a', '2h', '5j', '8n', '8n', '5j']

transformer = OneHotTransformer()
transformer.fit(data)
res = transformer.transform(data)

print("Encoded data:", res.toarray())

for multithread transform:

transformer = OneHotTransformer(n_jobs=5)

to back to single thread:

transformer.to_single_thread()

complete example

from rs_fast_one_hot import OneHotTransformer

data = ['1a', '1a', '2h', '5j', '8n', '8n', '5j']

transformer = OneHotTransformer(5)
transformer.fit(data)

res = transformer.transform(data)
print("Encoded data before save", res.toarray())

transformer.to_single_thread() # convert to single thread for prom usage
with open('transformer.pkl', 'wb') as f:
    pickle.dump(transformer, f)

# Load transformer from disk
with open('transformer.pkl', 'rb') as f:
    transformer2 = pickle.load(f)
res2 = transformer2.transform(data)
print("Encoded data after load from disk", res2.toarray())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

rs_fast_one_hot-0.1.0-cp313-cp313t-manylinux_2_28_x86_64.whl (358.1 kB view details)

Uploaded CPython 3.13tmanylinux: glibc 2.28+ x86-64

rs_fast_one_hot-0.1.0-cp313-cp313-win_amd64.whl (196.7 kB view details)

Uploaded CPython 3.13Windows x86-64

rs_fast_one_hot-0.1.0-cp313-cp313-manylinux_2_28_x86_64.whl (357.8 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

rs_fast_one_hot-0.1.0-cp312-cp312-win_amd64.whl (196.7 kB view details)

Uploaded CPython 3.12Windows x86-64

rs_fast_one_hot-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl (357.7 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

rs_fast_one_hot-0.1.0-cp311-cp311-win_amd64.whl (196.6 kB view details)

Uploaded CPython 3.11Windows x86-64

rs_fast_one_hot-0.1.0-cp311-cp311-manylinux_2_28_x86_64.whl (358.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

rs_fast_one_hot-0.1.0-cp310-cp310-win_amd64.whl (196.6 kB view details)

Uploaded CPython 3.10Windows x86-64

rs_fast_one_hot-0.1.0-cp310-cp310-manylinux_2_28_x86_64.whl (358.6 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

rs_fast_one_hot-0.1.0-cp39-cp39-win_amd64.whl (196.7 kB view details)

Uploaded CPython 3.9Windows x86-64

rs_fast_one_hot-0.1.0-cp39-cp39-manylinux_2_28_x86_64.whl (359.4 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

rs_fast_one_hot-0.1.0-cp38-cp38-win_amd64.whl (196.6 kB view details)

Uploaded CPython 3.8Windows x86-64

rs_fast_one_hot-0.1.0-cp38-cp38-manylinux_2_28_x86_64.whl (359.0 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.28+ x86-64

File details

Details for the file rs_fast_one_hot-0.1.0-cp313-cp313t-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rs_fast_one_hot-0.1.0-cp313-cp313t-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 517aa7117c7a618976a8bb51c92d4dce6e8005c758f1b778ec096a8d2dbac65d
MD5 6bb59ecf2e65477aa918e25c2d0ed800
BLAKE2b-256 5f00d82569618c85f54cc924cb058d26f81e86ac1d4194c989c2e3e44c88f6cb

See more details on using hashes here.

File details

Details for the file rs_fast_one_hot-0.1.0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for rs_fast_one_hot-0.1.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 b5c843f47f5dfaee076e48fee921d76cd126f6b1fd2a2389ecd6c9b27c8b77de
MD5 ae2fe050fd39a65e1c4126e1e2cd16aa
BLAKE2b-256 f0675f2faa2e3183a6a5cc0007bb991e2817ebb465d8e1190fb8f14f4ff13c52

See more details on using hashes here.

File details

Details for the file rs_fast_one_hot-0.1.0-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rs_fast_one_hot-0.1.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c46ee784a5de47a9c02bc480c08c20ceef8d10a28184d91955025b4572d1f4ef
MD5 5b43582dc41fc15eb5b50f357bb344ab
BLAKE2b-256 d66cd64824a821eee769b830afae2bcf910185cc1b71c9f355be21fae49d46a2

See more details on using hashes here.

File details

Details for the file rs_fast_one_hot-0.1.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for rs_fast_one_hot-0.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 f4dea624454c0da5730286bf8ec5c548428b538d00f19b8a807193d29c654e18
MD5 b8625b16285d74a6645e86c10cdbf2f1
BLAKE2b-256 24b684799c4e44f43df112dbe14e6bef6767a53b6cc24a0d0b73546a9f3c1ccb

See more details on using hashes here.

File details

Details for the file rs_fast_one_hot-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rs_fast_one_hot-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b17796e4500cd77f62d7d39d407f519b238362ec41bb06d1902639ad36d8d69d
MD5 01a03e88802168f6b960a4380255e7c1
BLAKE2b-256 77cb1522c8611efa4b9d12cb0850be2e2e14f820c04e47c68a4569efa4a5c288

See more details on using hashes here.

File details

Details for the file rs_fast_one_hot-0.1.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for rs_fast_one_hot-0.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a3e46e981e422734616b02b0a5ef10fd3ce9503c602d2ea07fa6d3d7599af691
MD5 a0266a053ceb5cb1378a023e8c65ed1c
BLAKE2b-256 7d775e80975fc347415f52bf7bdce92673fd8bf42fae1c9a4b1f5932a0610968

See more details on using hashes here.

File details

Details for the file rs_fast_one_hot-0.1.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rs_fast_one_hot-0.1.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cb0e879572f967d097b81a61a9c53faa2128fa61641e3a8396ebb0b2b10cc7b7
MD5 5a9b1b1bf5d0efe4796febcafff4a4ff
BLAKE2b-256 0c7e52d9c57837e76f9f48fa4936b37ebf04f1d80cc484e2f614156ac2c3cf25

See more details on using hashes here.

File details

Details for the file rs_fast_one_hot-0.1.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for rs_fast_one_hot-0.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 71c6924aede69629c7714b0325df9c02a84ab3f14b6e5f0724787f50b34a8942
MD5 85ee0432add8f35eff03a3c287709ee5
BLAKE2b-256 aeb850714cbe39a8cf57790d3526938cd5a22c91b4d41ea06095fce450a795a6

See more details on using hashes here.

File details

Details for the file rs_fast_one_hot-0.1.0-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rs_fast_one_hot-0.1.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 be4a4ffaf0377c146a1640bc893a4cff01b15247012df91cb22dac88f18875bf
MD5 ff6f900b203915b4c264a851abdcb1a2
BLAKE2b-256 17cc66f6f833b3aad8b66861a50081121d1b8440f56f00d6c6122100dc771822

See more details on using hashes here.

File details

Details for the file rs_fast_one_hot-0.1.0-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for rs_fast_one_hot-0.1.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 2d49f53b7cc8e6d5f67d48c38fcda6eed4d0760d9004bbf7fa9ba1e33835d19f
MD5 adabb3385fbfef802744ecb2243438ec
BLAKE2b-256 7214bdecbc89c871d243f2c6c764cb6c19b897f0d4f6b2f1800fde6df137cfa4

See more details on using hashes here.

File details

Details for the file rs_fast_one_hot-0.1.0-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rs_fast_one_hot-0.1.0-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e280a58b4bc12eb7ac389cc7198480c4a4551fd6ac2e25406683cd6d10c2ea25
MD5 42304f28c17102d3c979d6cf927c61a8
BLAKE2b-256 e5e57d5b8a4988e2d66754d03efb77e284d8de0cb95e7259aa9fd92ff0acf259

See more details on using hashes here.

File details

Details for the file rs_fast_one_hot-0.1.0-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for rs_fast_one_hot-0.1.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 528bf3a9088f206e18b8d951efbcb2b2aa3cb12e76cd831663d043a79268d9c2
MD5 16f76f0c5d289dc5202ac6f6bc6b84bb
BLAKE2b-256 3767102789a3f0cf295f3374c0a5e8a09baf16b37f4d419fc5936a26c8e983b7

See more details on using hashes here.

File details

Details for the file rs_fast_one_hot-0.1.0-cp38-cp38-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for rs_fast_one_hot-0.1.0-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 13d4e537652af9310544ba8e13ff635959ed0e7e4872b379bf00d5602d98167f
MD5 6dac2f103949b26d6ac20d50f05535cf
BLAKE2b-256 c7e2afb5d40e203fec57a784436aa753a9248f02129ea2da78926e3825eceb62

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