Skip to main content

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:

  1. 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


Download files

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

Source Distribution

MultiColumnLabelEncoder-1.1.3.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

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

MultiColumnLabelEncoder-1.1.3-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file MultiColumnLabelEncoder-1.1.3.tar.gz.

File metadata

  • Download URL: MultiColumnLabelEncoder-1.1.3.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for MultiColumnLabelEncoder-1.1.3.tar.gz
Algorithm Hash digest
SHA256 5034d46c2a89864ad43d6959709560d59b725494e139e4c96074a31679b7ad43
MD5 cdc1b1cca58102c3cba2e7bd239663ab
BLAKE2b-256 7ecf28ac8627f5fc62105fbc24f7d52d4128533bc4502c5e82574b405f026ecf

See more details on using hashes here.

File details

Details for the file MultiColumnLabelEncoder-1.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for MultiColumnLabelEncoder-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2909cc3e0c1b7e792d65a0baf48fcdee3f6b85574c53851d4e7d48a51fe3d759
MD5 65d67b145d3925a84fe3bc0c55f98e38
BLAKE2b-256 36f03459df3b094eb57caec71c26d8a6ee9d2b29c1677e8e096fb95f4f905402

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