Automated ML pipeline with EDA, imbalance detection (SMOTE) and basic model training
Project description
ML AutoPipeline
Automated Machine Learning pipeline for beginners.
Features:
- Dataset loading and basic exploratory data analysis (EDA)
- Class imbalance detection and SMOTE sampling
- Model training on Logistic Regression, Random Forest, and SVM
- Performance metrics: Accuracy, Precision, Recall, F1 Score
- Optional extended metrics (confusion matrix, ROC AUC)
- Structured logging (plain or JSON) + timing + optional progress bars
- Config-driven pipeline (YAML/JSON) & CLI flags
Installation
pip install ml-autopipeline
# With optional extras
pip install "ml-autopipeline[all]" # progress + config
pip install "ml-autopipeline[progress]" # just tqdm
pip install "ml-autopipeline[config]" # just PyYAML
Quick Start (CLI)
ml-autopipeline --file path/to/data.csv --target target_column --apply_smote
Add verbosity:
ml-autopipeline --file data.csv --target label -v # INFO
ml-autopipeline --file data.csv --target label -vv # DEBUG
Extended metrics & progress bar (needs extras installed):
ml-autopipeline --file data.csv --target label --extended-metrics --progress
JSON logs to file:
ml-autopipeline --file data.csv --target label --json-logs --log-file run.log
Use a config file (values can be overridden by CLI):
# config.yml
file: data.csv
target: label
apply_smote: true
extended_metrics: true
progress: true
verbose: 1
Run with config:
ml-autopipeline --config config.yml
Python Usage
from ml_autopipeline import (
load_data, basic_report, check_imbalance, apply_smote, train_models
)
# df = load_data("your.csv")
report = basic_report(df)
imbalance = check_imbalance(df, "target")
X = pd.get_dummies(df.drop(columns=["target"]))
y = df["target"]
if imbalance["is_imbalanced"]:
X, y = apply_smote(X, y)
results = train_models(X, y, extended_metrics=True, show_progress=True)
print(results)
Provided Functions
| Function | Description |
|---|---|
load_data(path) |
Load CSV into a pandas DataFrame |
basic_report(df) |
Return shape, columns, missing values, dtypes, head |
check_imbalance(df, target) |
Report class distribution and imbalance flag |
apply_smote(X, y) |
Oversample minority classes using SMOTE / fallback strategy |
train_models(X, y, ...) |
Train models and return metrics (+ optional extended metrics) |
Extended metrics keys (when enabled):
confusion_matrix: 2D listroc_aucorroc_auc_ovr_weighted(if probabilities available)
Logging & Timing
- Default log level: WARNING
-v-> INFO,-vv-> DEBUG--json-logsproduces JSON per line--log-file FILEduplicates logs to file- Timing for major steps included (split, fit per model)
Config Precedence
- CLI arguments (if provided)
- Config file values
Development Setup
python -m venv .venv
.venv\Scripts\activate
pip install -e .[dev,all]
pytest
Build & Publish
pip install build twine
python -m build
python -m twine upload --repository testpypi dist/*
# After verification
python -m twine upload dist/*
License
MIT
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 ml_autopipeline-0.2.0.tar.gz.
File metadata
- Download URL: ml_autopipeline-0.2.0.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ef828b4ca5402413a71cef1864a4028fd80429b72a5dd74d46f1d3f73fa5d26
|
|
| MD5 |
7dcec2381651206fb55a6c9c687c8b74
|
|
| BLAKE2b-256 |
fcad0b5e01d0a7a4e607f692b127bb1f60ef78540dd93569b9fa195a0301d386
|
File details
Details for the file ml_autopipeline-0.2.0-py3-none-any.whl.
File metadata
- Download URL: ml_autopipeline-0.2.0-py3-none-any.whl
- Upload date:
- Size: 13.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e91124abb95e58ba9bcdcbdbdd58b0dd8efd7cae6574a972b0826ad63201422
|
|
| MD5 |
cb8ac2b56e040b1224bca6b808a08a31
|
|
| BLAKE2b-256 |
3b1a794b1b1cc45dde31e6ee3114be0282402b6fe8fa0a60a7a28108906fd811
|