categorical-encoding
categorical-encoding is a Python library for encoding categorical data, intended for use with Featuretools. categorical-encoding allows for easy encoding of data and integration into Featuretools pipeline for automated feature engineering within the machine learning pipeline.
Install
python -m pip install "featuretools[categorical_encoding]"
Description
For more general questions regarding how to use categorical encoding in a machine learning pipeline, consult the guides located in the categorical encoding github repository.
import categorical_encoding as ce
encoder = ce.Encoder()
encoder.fit(feature_matrix, features)
fm_encoded_ordinal = encoder.transform(feature_matrix, features)
>>> feature_matrix
product_id purchased value countrycode
id
0 coke zero True 0.0 US
1 coke zero True 5.0 US
2 coke zero True 10.0 US
3 car True 15.0 US
4 car True 20.0 US
5 toothpaste True 0.0 AL
>>> fm_encoded_ordinal
PRODUCT_ID_ordinal purchased value COUNTRYCODE_ordinal
id
0 1 True 0.0 1
1 1 True 5.0 1
2 1 True 10.0 1
3 2 True 15.0 1
4 2 True 20.0 1
5 3 True 0.0 2
Supports easy integration into Featuretools through its support and use of features. Learn features through fitting an encoder to data, and then use those features to easily generate new tables of encoded data.
>>> features = encoder.get_features()
[<Feature: PRODUCT_ID_ordinal>,
<Feature: purchased>,
<Feature: value>,
<Feature: COUNTRYCODE_ordinal>]
>>> feature_matrix_2 = ft.calculate_feature_matrix(features, es)
PRODUCT_ID_ordinal purchased value COUNTRYCODE_ordinal
id
0 1 True 0.0 1
1 1 True 5.0 1
2 1 True 10.0 1
3 2 True 15.0 1
4 2 True 20.0 1
5 3 True 0.0 2
Feature Labs
categorical-encoding is an open source project created by Feature Labs. To see the other open source projects we're working on visit Feature Labs Open Source. If building impactful data science pipelines is important to you or your business, please get in touch.
Metadata
Release files for categorical-encoding 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| categorical_encoding-0.1.0.tar.gz | 9.3 kB | Without provenance | Details for categorical_encoding-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| categorical_encoding-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for categorical_encoding-0.1.0-py3-none-any.whl |
Total release size: 24.0 kB
Release files / categorical_encoding-0.1.0.tar.gz
| Download URL | categorical_encoding-0.1.0.tar.gz |
|---|---|
| Size | 9.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c9538389c7d231bd1c53c5b2ded19660e4c63b384f277127fb1afddc8f874179
|
|
BLAKE2b-256 checksum How to use checksums |
31ea8dd1a6fa203a0a92434c2521fbc94ed44eaea31ac12614ce76b1cbcce2f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.7.3
|
Release files / categorical_encoding-0.1.0-py3-none-any.whl
| Download URL | categorical_encoding-0.1.0-py3-none-any.whl |
|---|---|
| Size | 14.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0c5e78009c9a4634fdaea1696d3e26b8b87536c5eb60992a9dbf34734bae88f4
|
|
BLAKE2b-256 checksum How to use checksums |
e77475dd2c9232ad35277b31c563aa70ea63885f77474470e99ac25c8b24ba56
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.7.3
|
Security for categorical-encoding 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.