Skip to main content

A collection of feature engineering methods for preprocessing datasets.

Project description

Feature Engineering Utilities

This Python module provides a collection of feature engineering methods for preprocessing datasets using Pandas. It includes various encoding techniques and scaling methods, which can be used to transform categorical and numerical data for machine learning models.

📦 Class: FeatureEngineering

🔧 Methods

1. OneHot_En(df)

Performs One-Hot Encoding on all columns of the given DataFrame.

  • Input: DataFrame with categorical columns.
  • Output: DataFrame with one-hot encoded columns.

2. Lable_En(df)

Applies Label Encoding to all columns.

  • Input: DataFrame with categorical data.
  • Output: DataFrame with integer-encoded values.

3. Order_En(o_list, df)

Applies Ordinal Encoding based on the given list of ordered values.

  • Input:
    • o_list: List of lists with ordered values.
    • df: DataFrame with categorical data.
  • Output: Ordinal encoded DataFrame.

4. Target_En(df, Target_column_df)

Applies Target Encoding based on the average of the target column for each category.

  • Input:
    • df: DataFrame with categorical features.
    • Target_column_df: DataFrame with the target column.
  • Output: Encoded DataFrame using target mean values.

5. Freq_En(df)

Applies Frequency Encoding to all columns.

  • Input: DataFrame with categorical values.
  • Output: DataFrame with frequency-based values.

6. Bin_En(df)

Encodes numeric values as binary string representations based on their position.

  • Input: DataFrame with numerical or categorical data.
  • Output: DataFrame with binary representations.

7. Stannd_Scale(df)

Applies Standard Scaling (Z-score) to numerical columns.

  • Input: DataFrame with numerical features.
  • Output: DataFrame with standardized values.

8. Normm_Scale(df)

Applies Min-Max Normalization to numerical columns.

  • Input: DataFrame with numerical features.
  • Output: DataFrame with normalized values between 0 and 1.

🚀 How to Use

from Preprocess import  FeaturEngineering
import pandas as pd

df = pd.DataFrame({...})  # your input data
fe = Preprocess()

encoded_df = fe.OneHot_En(df)       # One-Hot Encoding
labeled_df = fe.Lable_En(df.copy()) # Label Encoding

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

featureeng_arun8nov-0.0.1.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

featureeng_arun8nov-0.0.1-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file featureeng_arun8nov-0.0.1.tar.gz.

File metadata

  • Download URL: featureeng_arun8nov-0.0.1.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for featureeng_arun8nov-0.0.1.tar.gz
Algorithm Hash digest
SHA256 261caf3115e2fc0a6b1727765b7a0c9e159456620d6c04a0d6900fa149dc1a61
MD5 2ba3f81ebf6e1e42f0ae1391b5d957c4
BLAKE2b-256 864a330928007238f69dca45546cf8079aa12ef5933e12433cb7ec8c9dadd0e4

See more details on using hashes here.

File details

Details for the file featureeng_arun8nov-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for featureeng_arun8nov-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c68bb299abfa935ea31835b0bf4298dcbcd217d4306ee82767c03a8227d9cb86
MD5 56f5d6f45373156224360e9641305e7b
BLAKE2b-256 46fe86290817daa0ba9e8c53033cb564d7524701749d819b1e575f65fe753cf6

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