One-line smart preprocessing for ML: impute, encode, scale, and (optionally) clip outliers.
Project description
🧠 smart-preprocess-asif
A lightweight, one-line data preprocessing toolkit for machine learning workflows.
🚀 Install
pip install smart-preprocess-asif
💡 Quick Start
import pandas as pd
from smart_preprocess import SmartCleaner
df = pd.DataFrame({
"age": [20, None, 1000],
"city": ["NY", "LA", None]
})
cleaner = SmartCleaner(outlier_clip=True)
X = cleaner.fit_transform(df)
print("✅ Cleaned DataFrame:")
print(X.head())
print("\nReport:")
print(cleaner.report_)
Output:
✅ Cleaned DataFrame:
age__scaled city_LA city_NY city_None
0 -1.224745 0.0 1.0 0.0
1 0.000000 1.0 0.0 0.0
2 1.224745 0.0 0.0 1.0
Report:
{'numeric_cols': ['age'], 'categorical_cols': ['city'], ...}
🔍 Features
✅ Automatic missing value imputation
✅ Outlier clipping (IQR method)
✅ Feature scaling using StandardScaler
✅ One-hot encoding for categorical variables
✅ Compact report dictionary summarizing transformations
🧩 Why use smart-preprocess-asif?
In ML projects, preprocessing pipelines often require 10–15 lines of repetitive boilerplate.
smart-preprocess-asif condenses those steps into one reusable, customizable class —
built with pandas + scikit-learn for performance and reliability.
🧪 Example Use Case
Integrate it into a scikit-learn pipeline:
from sklearn.pipeline import Pipeline
from smart_preprocess import SmartCleaner
from sklearn.linear_model import LogisticRegression
pipe = Pipeline([
("prep", SmartCleaner(outlier_clip=True)),
("model", LogisticRegression())
])
pipe.fit(X_train, y_train)
🛠 Requirements
Python ≥ 3.9
pandas ≥ 2.0
scikit-learn ≥ 1.3
numpy ≥ 1.24
1.24
🤝 Contributing
Pull requests are welcome!
Issues
📜 License
Licensed under the MIT License © 2025 Asif Pinjari
🌟 Support
If you find this project useful, please share it:
🔗 PyPI:
https://pypi.org/project/smart-preprocess-asif/
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file smart_preprocess_asif-0.1.2.tar.gz.
File metadata
- Download URL: smart_preprocess_asif-0.1.2.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73333333eed3670493b2518f0f994e1a9eb010d74f87ed296e855fc6a2c5d1b3
|
|
| MD5 |
6d3e9bead85a241087e53451de3ec010
|
|
| BLAKE2b-256 |
4386e96d7ac79e244030f4c046c9fe87d141c98085964d58acb380ddfa16cfb6
|
File details
Details for the file smart_preprocess_asif-0.1.2-py3-none-any.whl.
File metadata
- Download URL: smart_preprocess_asif-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2cb5e6354d0644f618e2e84e0ee0613ae441f04b4123213234bb358555fcdc41
|
|
| MD5 |
d15faff270190747f439a927857a6030
|
|
| BLAKE2b-256 |
9b7a6b7c33cf131d5107fe9ed397e2f16efcf4629467eb0783724d4d173e2457
|