A pip-installable Python library that takes a raw pandas DataFrame and returns a cleaned DataFrame, a reusable sklearn Pipeline, and a structured Report — automatically.
Project description
PreFlight-ML
A pip-installable Python library that takes a raw pandas DataFrame and returns a cleaned DataFrame, a reusable sklearn Pipeline, and a structured Report — automatically.
![PyPI version placeholder] ![License placeholder]
Installation
# Coming soon to PyPI!
# pip install preflight-ml
# For now, install from source:
git clone https://github.com/VAIyerAmogha/PreFlight.git
cd PreFlight
pip install .
Quickstart
import preflight as pf
import pandas as pd
# Load your raw, messy dataset
df = pd.read_csv("data.csv")
# Run the full preparation pipeline
result = pf.prepare(
df=df,
target="price",
task="regression",
model_hint="tree"
)
# 1. Inspect the fully cleaned and engineered dataset
print(result.df.head())
# 2. Review the automated decisions report
result.report.show()
# 3. Use the scikit-learn Pipeline on new data
pipeline = result.pipeline
new_data = pd.read_csv("new_data.csv")
# predictions = my_model.predict(pipeline.transform(new_data))
Features
PreFlight-ML eliminates mechanical data preparation work without creating a black box. Every transform is explainable and reproducible.
Profiler
- Semantic Type Inference: Automatically infers 8 semantic types (e.g.
NUMERIC_FEATURE,CATEGORICAL_HIGH,DATETIME_NATIVE). - Signal Extraction: Calculates missingness rates, outlier prevalence, cardinality, correlation, mutual information, class imbalance, and leakage flags.
- VIF & Multicollinearity: Detects collinear features to prevent mathematical instability.
Cleaner
- Imputation: Intelligent median, mode, and constant imputation with automatic missing indicators.
- Structural Remediation: Drops high-missingness and numeric ID columns, removes duplicate rows, and coerces string dates.
- Value-Level Fixing: Winsorizes outliers, normalizes category strings, and groups rare categories.
Engineer
- Encoding Strategies: Applies ordinal encoding, one-hot encoding, and 5-fold cross-fit target encoding (to prevent target leakage).
- Scaling & Transformations: Applies
StandardScalerandlog1ptransforms where mathematically safe. - Datetime Expansion: Automatically extracts features from date columns (year, month, day, day of week).
Report
- Transparent Logging: Every automated decision is logged with its rationale and severity.
- Visualizations: Generates EDA charts using
result.report.plot(). - Export Options: Export the report to terminal, DataFrame, JSON, or embedded HTML.
CLI Usage
PreFlight-ML can be used directly from the command line:
preflight prepare data.csv --target price --task regression --model-hint tree
This will generate:
data_prepared.csvdata_pipeline.joblibdata_report.json
Scope and Boundaries
What is in scope (v0.1.0):
- Fully automated data cleaning and feature engineering.
- Explainable preprocessing logs.
- Generation of an exportable scikit-learn
Pipeline.
Explicitly OUT OF SCOPE:
- Model training, hyperparameter tuning, or AutoML model selection.
- Destructive feature selection (we do not drop columns silently based on mutual information).
- Target variable transformation.
For full architectural details, see the Architecture Docs (Note: currently an internal development document, but will be expanded in future releases).
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
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 pypreflight-0.1.0.tar.gz.
File metadata
- Download URL: pypreflight-0.1.0.tar.gz
- Upload date:
- Size: 46.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38a6dab0784773170890bf25adb52a9138b2564ce2363aebe6015c36be044547
|
|
| MD5 |
3263987c54ef81d6f85dedf107b62ece
|
|
| BLAKE2b-256 |
62fc001cca120073af94aa836c4312cbd96dd1f59ed8df08eeb11412f2baf820
|
File details
Details for the file pypreflight-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pypreflight-0.1.0-py3-none-any.whl
- Upload date:
- Size: 27.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c39f0dbf00a0e88d5cf513fcb1db7c1ab586566b3bc737cf679fda3cee4edbd
|
|
| MD5 |
abc4d588995a26af296a56b8a9483896
|
|
| BLAKE2b-256 |
e5275a745e9c17359b98c52e3a7d4769b1cbebbafac95bbe38545f34037529cc
|