Skip to main content

A collection of feature engineering methods for preprocessing datasets.

Project description

📦 FeatureEngineering

FeatureEngineering is a Python package that provides multiple encoding and scaling techniques for preprocessing categorical and numerical data. It’s lightweight, dependency-free (except for pandas and numpy), and ideal for rapid feature engineering during model development.


📌 Key Features

✅ One-Hot Encoding
✅ Label Encoding
✅ Ordinal Encoding
✅ Target Encoding
✅ Frequency Encoding
✅ Binary Encoding
✅ Standard Scaling (Z-Score)
✅ Normalization Scaling (Min-Max)


📥 Installation

Install the package using pip:

pip install FeatureEng_arun8nov

Ensure you have pandas and numpy installed.


🔧 How to Use

Step 1: Import the Class

from Preprocess import FeatureEngineering
import pandas as pd

Step 2: Create Sample Data

df = pd.DataFrame({
    'Color': ['Red', 'Blue', 'Green', 'Red'],
    'Size': ['S', 'M', 'L', 'S']
})

Step 3: Initialize the Class

fe = FeatureEngineering()

🧠 Encoding Methods

1. One-Hot Encoding

ohe_df = fe.OneHot_En(df[['Color']])

2. Label Encoding

label_df = fe.Lable_En(df[['Color']].copy())

3. Ordinal Encoding

order_list = [['S', 'M', 'L']]
ord_df = fe.Order_En(order_list, df[['Size']].copy())

4. Target Encoding

target = pd.DataFrame({'Price': [100, 200, 300, 150]})
target_encoded_df = fe.Target_En(df[['Color']], target)

5. Frequency Encoding

freq_df = fe.Freq_En(df[['Color']].copy())

6. Binary Encoding

bin_df = fe.Bin_En(df[['Color']].copy())

📏 Scaling Methods

For numerical columns:

num_df = pd.DataFrame({'Age': [20, 25, 30], 'Salary': [30000, 50000, 70000]})

7. Standard Scaling (Z-Score)

std_df = fe.Stannd_Scale(num_df)

8. Normalization (Min-Max)

norm_df = fe.Normm_Scale(num_df)

🧾 Function Summary

Method Purpose Input Type
OneHot_En One-Hot Encode categorical data DataFrame
Lable_En Label Encode categorical data DataFrame
Order_En Ordinal Encode based on user order DataFrame + list
Target_En Encode using target mean per category DataFrame + target column as DataFrame
Freq_En Encode based on frequency count DataFrame
Bin_En Encode as binary numbers DataFrame
Stannd_Scale Apply Z-score scaling Numerical DataFrame
Normm_Scale Apply Min-Max scaling Numerical DataFrame

🔐 License

This package is licensed under the MIT License.


👨‍💻 Author

Arunprakash B
GitHub: [arun8nov]
LinkedIn: [https://www.linkedin.com/in/arun8nov/]


📢 Note

This package is ideal for:

  • ML beginners looking to understand encodings manually
  • Rapid prototyping pipelines
  • Educational and academic projects

🙋 Need Help?

If you encounter any bugs or have suggestions, please open an issue on GitHub.

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.2.tar.gz (4.5 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.2-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: featureeng_arun8nov-0.0.2.tar.gz
  • Upload date:
  • Size: 4.5 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.2.tar.gz
Algorithm Hash digest
SHA256 e0e62e7c391ce16bc11d72f2107a4c4fe8fe6293f24ad2b379419c4c67967c29
MD5 ed3d85f1ce6b8b2c2a4ff62570780583
BLAKE2b-256 4e1504c4f8fd1e6dcc65321cc735d3b2152653731cdf5c81d6e8fcb5d0b75e39

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for featureeng_arun8nov-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9ab4bdcede4b5e25ee31233052911fcf38f115a6295b2fcbb9413c3195f04860
MD5 b1bc754d8f7fa700ab510f07980dedc3
BLAKE2b-256 d1c937d1890d899d0933947c4a1b590e80bff278cf924c89718ca12abe06a99c

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