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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page