advprep: Advanced Data Preprocessing Toolkit
advprep is a Python package providing advanced tools for data preprocessing, including imputation, encoding, scaling, feature engineering, and an easy-to-use preprocessing pipeline. It helps you clean and prepare your datasets efficiently for machine learning or analysis.
Installation
Make sure you have these dependencies installed:
pip install pandas numpy scikit-learn category_encoders
Then, include the advprep package files in your project folder or install it as a local package.
Modules and Usage
1. Imputation (imputation.py)
Handle missing data with different strategies like mean, median, mode, forward-fill, backward-fill, KNN, and iterative imputation.
from advprep.imputation import AdvancedImputer
import pandas as pd
df = pd.read_csv("data.csv")
imputer = AdvancedImputer(method="knn", knn_neighbors=3)
df_imputed = imputer.fit_transform(df)
2. Encoding (encoding.py)
Encode categorical features using One-Hot, Ordinal, or Target encoding.
from advprep.encoding import AdvancedEncoder
encoder = AdvancedEncoder(method="onehot")
df_encoded = encoder.fit_transform(df, columns=["CategoryCol1", "CategoryCol2"])
For target encoding:
encoder = AdvancedEncoder(method="target")
df_encoded = encoder.fit_transform(df, columns=["CategoryCol"], target="TargetColumn")
3. Scaling (scaling.py)
Scale numerical features using StandardScaler, MinMaxScaler, RobustScaler, or PowerTransformer.
from advprep.scaling import AdvancedScaler
scaler = AdvancedScaler(method="minmax")
df_scaled = scaler.fit_transform(df)
4. Feature Engineering (feature_engineering.py)
Create new features like date parts or polynomial features.
Extract date/time features:
from advprep.feature_engineering import FeatureEngineer
df_features = FeatureEngineer.extract_date_features(df, date_column="OrderDate")
Generate polynomial features:
df_poly = FeatureEngineer.generate_polynomial_features(df, columns=["Feature1", "Feature2"], degree=3)
5. Pipeline (pipeline.py)
Combine multiple preprocessing steps into a single pipeline for easy and repeatable workflows.
from advprep.imputation import AdvancedImputer
from advprep.encoding import AdvancedEncoder
from advprep.scaling import AdvancedScaler
from advprep.pipeline import PreprocessingPipeline
pipeline = PreprocessingPipeline(steps=[
AdvancedImputer(method="median"),
AdvancedEncoder(method="onehot"),
AdvancedScaler(method="standard")
])
df_processed = pipeline.fit_transform(df)
Notes
- For target encoding, always provide the target column name when fitting.
- Date columns must be parseable by
pd.to_datetimefor date feature extraction. - By default, most methods operate on all suitable columns (numeric for imputation/scaling, categorical for encoding). You can specify
columnsto limit processing. - The pipeline applies the steps sequentially to the DataFrame.
- The iterative imputer uses Bayesian Ridge by default and requires scikit-learn version supporting it.
category_encodersis required
Metadata
Release files for advprep 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| advprep-0.1.2.tar.gz | 5.7 kB | Without provenance | Details for advprep-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| advprep-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for advprep-0.1.2-py3-none-any.whl |
Total release size: 13.1 kB
Release files / advprep-0.1.2.tar.gz
| Download URL | advprep-0.1.2.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4a538b95f5d40fbbed7f1988672036e12467c94ddc7210a27dc46d80a909e1d2
|
|
BLAKE2b-256 checksum How to use checksums |
8fb2ee234e5440f9b0f8ec559e27f5b1f5bb66102751b899fdd84fc12c638b0e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.2
|
Release files / advprep-0.1.2-py3-none-any.whl
| Download URL | advprep-0.1.2-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9e61cf8083ee827aaf5b35e0db20d7daa8a80aab6638ca27b2d730b954441204
|
|
BLAKE2b-256 checksum How to use checksums |
0309b76753ebef5df82c7821b165be9ffa0da12f5117d87d99f93cb15c875c28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.2
|
Security for advprep 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.