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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rs_fast_one_hot-0.1.1-cp313-cp313t-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: rs_fast_one_hot-0.1.1-cp313-cp313t-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 358.1 kB
- Tags: CPython 3.13t, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8052bf30c8051e9b86c25e793c795175a381f7d0f617c4fa83cd817e8015fc14
|
|
| MD5 |
d5907f45a84cd35086fd43f6c55a4413
|
|
| BLAKE2b-256 |
25e2afeded7ddf045ce1469c8da7d364d6fa03a0a3cc2349278e743470259b29
|
File details
Details for the file rs_fast_one_hot-0.1.1-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: rs_fast_one_hot-0.1.1-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 196.8 kB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bfd0f64d8ae79ba6d3008d4e4b35a6ad9ea77d6ffecaebf479e31ef5666d8146
|
|
| MD5 |
e323d1ea3ee4abac0141b6cb4a74b550
|
|
| BLAKE2b-256 |
889ca9190cb1ef69fc03c6bf9893fcf6682881ee4586c827c84ce6512e17914d
|
File details
Details for the file rs_fast_one_hot-0.1.1-cp313-cp313-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: rs_fast_one_hot-0.1.1-cp313-cp313-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 358.1 kB
- Tags: CPython 3.13, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1757896a29698c51f02f4ea0c98e4a8b09410fb910b204f5be3503ec4dc3128
|
|
| MD5 |
d7c2eef484050313a8837ec406ddce1a
|
|
| BLAKE2b-256 |
a409516e0430741f5662977d1871c8fe6342a25d2f6746e7e5b992187289a248
|
File details
Details for the file rs_fast_one_hot-0.1.1-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: rs_fast_one_hot-0.1.1-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 196.8 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dac2b90743a601a2f76c05906847debfbf1a11a2f6b87e67e13d05855bb51b7d
|
|
| MD5 |
7fd6534d00575e75d889990c1ed7b173
|
|
| BLAKE2b-256 |
bffa65a3fc39d8e3b84eb0e8c608f9fe2fb22ae556cf9dff687702b3a8b3d687
|
File details
Details for the file rs_fast_one_hot-0.1.1-cp312-cp312-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: rs_fast_one_hot-0.1.1-cp312-cp312-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 357.9 kB
- Tags: CPython 3.12, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52bad522adf8c407e26e6da2f3845863c9fd62e39e825847b76838eb902aa15b
|
|
| MD5 |
858d6614833c940a5a8e234d1d2e8aa2
|
|
| BLAKE2b-256 |
977bff1b5a0ad855e5ee2b5d148e494dfd8028fd2e30f30f4c8360a0a9129909
|
File details
Details for the file rs_fast_one_hot-0.1.1-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: rs_fast_one_hot-0.1.1-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 196.7 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c95b1e3e06013ddc3055b27133d631b1ee035b6f0981b9904a038938778b14c1
|
|
| MD5 |
f34125007503fe758947b0c0350ffa5e
|
|
| BLAKE2b-256 |
ab61aad49b43daa171292b5844562653ff556d55a89ca6e2f1b55b81ec933c15
|
File details
Details for the file rs_fast_one_hot-0.1.1-cp311-cp311-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: rs_fast_one_hot-0.1.1-cp311-cp311-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 358.4 kB
- Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44142c841081c1157d286384d9fbe8c5e40de2b0cf5ba69ecee94f75f157f029
|
|
| MD5 |
3c924365705d522ecfb28df65da599c6
|
|
| BLAKE2b-256 |
bd8c2054fbc8587fbdb3f39134bdf0f2f5de4242763867162714ef4eed1584cb
|
File details
Details for the file rs_fast_one_hot-0.1.1-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: rs_fast_one_hot-0.1.1-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 196.7 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6119cc80445f60595c5a853d28a8e052bc58901a79bf7054670f32842e97684d
|
|
| MD5 |
b07e9fcce8246765dd368524708c9b11
|
|
| BLAKE2b-256 |
f8d272c6152feebb48fec756d87d941965aa50372952bac3825282f7d21c0b8b
|
File details
Details for the file rs_fast_one_hot-0.1.1-cp310-cp310-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: rs_fast_one_hot-0.1.1-cp310-cp310-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 358.5 kB
- Tags: CPython 3.10, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ec97445d3a6cc32f83067a74b64f69e31dc2a32c1bf607470b2d3d13e78f6da
|
|
| MD5 |
339927cb6aa2ba0f7b0ab60dbbb89183
|
|
| BLAKE2b-256 |
4944f4b94fde5dc52ce9c240f3a83a02146611733973dc2e4e7e87bd2782e93c
|
File details
Details for the file rs_fast_one_hot-0.1.1-cp39-cp39-win_amd64.whl.
File metadata
- Download URL: rs_fast_one_hot-0.1.1-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 196.7 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b80453db697f6fe24f9be37e19f5bfcb57c79c0cf8f7e24636fe27ae35c54edc
|
|
| MD5 |
eada3ed86a281bc74ee92ca52679c43b
|
|
| BLAKE2b-256 |
2f4671ae9f936f230a39fbf767936e05bebc73936a09f0cd4d3a5f9bb5d07c1e
|
File details
Details for the file rs_fast_one_hot-0.1.1-cp39-cp39-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: rs_fast_one_hot-0.1.1-cp39-cp39-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 359.1 kB
- Tags: CPython 3.9, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98e3000984a6108438f736ac4e6262a2df56846a885a320376d965df3005dd83
|
|
| MD5 |
dd8de8dacf02d6e7cc4698fb861f9f5c
|
|
| BLAKE2b-256 |
b3aa6e9a79adf874ee3d24a9878374792253f671146fe6f4718248d8cfaa7312
|
File details
Details for the file rs_fast_one_hot-0.1.1-cp38-cp38-win_amd64.whl.
File metadata
- Download URL: rs_fast_one_hot-0.1.1-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 196.7 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1830f18232b9cf232d469a40f0477eabe00eed1a30cc8f53334e7cccbc12b75b
|
|
| MD5 |
abc0a41877966ec9b31596f60ce43d70
|
|
| BLAKE2b-256 |
03b4069c4c6ccd0c11ce2646c655cdc97359f18ca54d8127910aa7ee1585d416
|
File details
Details for the file rs_fast_one_hot-0.1.1-cp38-cp38-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: rs_fast_one_hot-0.1.1-cp38-cp38-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 358.7 kB
- Tags: CPython 3.8, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6b96504f162c8345572373f59cf9c540dacc34ebf8a3480614b231bff124a4f
|
|
| MD5 |
7ce6244c0e90408b24f5daecd994d512
|
|
| BLAKE2b-256 |
da5c3895985da8d705169be2df04ceffad77ed4ece6653e37b199163995e94e1
|