Label Encoder which is used for encoding multiple categorical columns in a dataframe and inversing it
Project description
MultiColumnLabelClassification
Description:
For categorical Data, Encoding data is an important step, as various Machine Learning models will not work for textual data. So in existing encoding methods, which are already available, After transforming the data and encoding it, I found Inverse Transforming it is too hard, when Multiple categorical columns are encoded. And while we are developing machine learning models, we need to do label encoding for training and testing data, and they should be in sync to transform them back to original form. So Unable to find an easy existing approach to perform it, I have built this small module, to help myself when I am encoding data in Machine Learning Using python.
Usage:
-
For Encoding the data:
Import the label encoder:
import MultiColumnLabelEncoder
Using the label encoder:
le = MultiColumnLabelEncoder() encoded_dataframe = le.fit_transform(dataframe) [Note: columns argument can also be passed if we want encoding only for certain columns. By default it will be none and it will encode all the categorical columns]
Using the inverse label encoder:
inverse_encoded_dataframe = le.inverse_fit_transform(encoded_dataframe) [Note: columns argument can also be passed if we want inverse encoding only for certain columns. By default it will be none and it will encode all the categorical columns]
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 Distribution
Built Distribution
Hashes for MultiColumnLabelEncoder-1.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5034d46c2a89864ad43d6959709560d59b725494e139e4c96074a31679b7ad43 |
|
MD5 | cdc1b1cca58102c3cba2e7bd239663ab |
|
BLAKE2b-256 | 7ecf28ac8627f5fc62105fbc24f7d52d4128533bc4502c5e82574b405f026ecf |
Hashes for MultiColumnLabelEncoder-1.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2909cc3e0c1b7e792d65a0baf48fcdee3f6b85574c53851d4e7d48a51fe3d759 |
|
MD5 | 65d67b145d3925a84fe3bc0c55f98e38 |
|
BLAKE2b-256 | 36f03459df3b094eb57caec71c26d8a6ee9d2b29c1677e8e096fb95f4f905402 |