Skip to main content

Production-level automated ML pipeline โ€” from raw data to deployed model in one line

Project description

๐Ÿ”ฅ open-mlpipe

Production-level automated ML pipeline โ€” from raw data to deployed model in one line.

PyPI version Python Downloads License: MIT GitHub stars


pip install open-mlpipe ยท 14+ Models ยท Auto EDA ยท Optuna Tuning ยท SHAP Explainability ยท Production Ready


Quick Start ยท Features ยท Models ยท API ยท CLI ยท Config ยท Examples


โšก Quick Start

Install

pip install open-mlpipe

One Line. Done.

from open_mlpipe import run

# Full pipeline โ€” data to production model
ctx = run("dataset.csv", target="price")

# Access results
print(f"Best model: {ctx.best_model_name}")
print(f"Test Rยฒ: {ctx.metrics['test_r2']:.4f}")

# Load saved model for predictions
import joblib
model = joblib.load("artifacts/model_v1.joblib")
predictions = model.predict(new_data)

CLI

# Zero-touch โ€” auto-detect everything
open-mlpipe run --data dataset.csv

# With target specified
open-mlpipe run --data dataset.csv --target price

# Config-driven
open-mlpipe run --config configs/regression.yaml

๐ŸŽฏ What It Does

Raw Data โ†’ EDA โ†’ Clean โ†’ Feature Eng โ†’ Split โ†’ Preprocess
โ†’ Compare 14 Models โ†’ Tune โ†’ Select โ†’ Evaluate โ†’ Explain โ†’ Save

All automatic. All production-ready. One command.

Stage What Happens
๐Ÿ“Š Load & EDA Auto-detect task, profile data, statistical tests
๐Ÿงน Clean Duplicates, outliers, missing values, ID columns
๐Ÿ”ง Feature Eng Interactions, log transforms, missingness flags, datetime
โœ‚๏ธ Split Stratified train/test split
โš™๏ธ Preprocess Impute, scale, encode (ColumnTransformer)
๐Ÿ† Compare 14+ models head-to-head with cross-validation
๐ŸŽ›๏ธ Tune Optuna hyperparameter optimization
๐Ÿ“ˆ Select SHAP-based feature importance
โœ… Evaluate Rยฒ, RMSE, MAE, MAPE, F1, ROC-AUC, MCC
๐Ÿ’ก Explain SHAP summary, dependence, waterfall plots
๐Ÿ’พ Save Full inference pipeline (feature_eng + model)

๐Ÿค– Supported Models

Linear

Model Type
Ridge Regression
Lasso Regression
ElasticNet Regression
LinearRegression Regression
LogisticRegression Classification

Tree & Ensemble

Model Type
DecisionTree Both
RandomForest Both
ExtraTrees Both

Boosting

Model Type
XGBoost Both
LightGBM Both
GradientBoosting Both
HistGradientBoosting Both
AdaBoost Both

Instance & Probabilistic

Model Type
KNN Both
SVM Both
NaiveBayes Classification

Ensemble

Model Type
Stacking Both
Voting Both

Auto-selected based on data characteristics and task type.


๐Ÿ Python API

Simple Usage

from open_mlpipe import run

ctx = run("data.csv", target="price")

Advanced Usage

from open_mlpipe import PipelineConfig, PipelineRunner
from open_mlpipe.config.resolver import build_level1_config

# Build config
config = build_level1_config("data.csv", target="price")
config.project = "my-project"
config.tuning.enabled = True
config.tuning.n_trials = 50

# Run pipeline
runner = PipelineRunner(config)
ctx = runner.run()

# Access everything
print(ctx.best_model_name)  # "lightgbm"
print(ctx.metrics["test_r2"])  # 0.847
print(ctx.metrics["test_mape"])  # 16.77

Config-Driven

from open_mlpipe import run_config

ctx = run_config("configs/regression.yaml")

๐Ÿ’ป CLI Usage

Commands

# Full pipeline
open-mlpipe run --data dataset.csv

# With options
open-mlpipe run --data dataset.csv --target price --project my-project

# Config-driven
open-mlpipe run --config configs/regression.yaml

# EDA only (no training)
open-mlpipe profile --data dataset.csv

Options

--data, -d       Path to data file (CSV, Parquet, Excel)
--target, -t     Target column name (auto-detected if not given)
--level, -l      Automation level (1=zero-touch, 2=config-driven)
--config, -c     Path to YAML config file
--project, -p    Project name
--deploy         Generate deployment artifacts

๐Ÿ“‹ YAML Config

# configs/regression.yaml
project: insurance-charges
task: auto
data:
  path: data/insurance.csv
  target: charges
  test_size: 0.2

model_selection:
  candidates: [lightgbm, xgboost, random_forest, ridge]
  scoring: [r2, neg_mean_absolute_error]
  ranking_primary: r2

tuning:
  enabled: true
  engine: optuna
  n_trials: 50
  timeout: 600

feature_selection:
  enabled: true
  method: shap_importance
  min_importance: 0.01

evaluation:
  explainability: true
  shap_plots: [summary, dependence, waterfall]

Run it:

open-mlpipe run --config configs/regression.yaml

๐Ÿ“Š Example Output

=== open-mlpipe Pipeline Runner ===
  Project:  california-housing
  Data:     california_housing.csv
  Target:   median_house_value

>> load        OK (0.1s)
>> eda         OK (0.2s)
>> clean       OK (0.0s)
>> feature_eng OK (0.0s)
>> split       OK (0.0s)
>> preprocess  OK (0.0s)
>> compare     OK (25.9s)  โ€” tested 14 models
>> tune        OK (20.2s)  โ€” Optuna 20 trials
>> select      OK (0.0s)
>> evaluate    OK (0.0s)
>> explain     OK (3.3s)
>> save        OK (0.1s)

=== Pipeline Complete ===
  Best Model:  lightgbm
  Test Rยฒ:     0.8474
  Test MAE:    0.2924
  Test MAPE:   16.77%

๐Ÿ—๏ธ Architecture

open-mlpipe/
โ”œโ”€โ”€ src/open_mlpipe/
โ”‚   โ”œโ”€โ”€ cli.py              # CLI entry point
โ”‚   โ”œโ”€โ”€ config/             # Pydantic config + YAML resolver
โ”‚   โ”œโ”€โ”€ core/               # Pipeline runner, context, stages
โ”‚   โ”œโ”€โ”€ stages/             # 12 pipeline stages
โ”‚   โ”‚   โ”œโ”€โ”€ load.py         # Data loading
โ”‚   โ”‚   โ”œโ”€โ”€ eda.py          # Exploratory data analysis
โ”‚   โ”‚   โ”œโ”€โ”€ clean.py        # Data cleaning
โ”‚   โ”‚   โ”œโ”€โ”€ feature_eng.py  # Feature engineering
โ”‚   โ”‚   โ”œโ”€โ”€ split.py        # Train/test split
โ”‚   โ”‚   โ”œโ”€โ”€ preprocess.py   # Preprocessing pipeline
โ”‚   โ”‚   โ”œโ”€โ”€ compare.py      # Model comparison
โ”‚   โ”‚   โ”œโ”€โ”€ tune.py         # Hyperparameter tuning
โ”‚   โ”‚   โ”œโ”€โ”€ select.py       # Feature selection
โ”‚   โ”‚   โ”œโ”€โ”€ evaluate.py     # Model evaluation
โ”‚   โ”‚   โ”œโ”€โ”€ explain.py      # SHAP explainability
โ”‚   โ”‚   โ””โ”€โ”€ save.py         # Model saving
โ”‚   โ”œโ”€โ”€ utils/              # I/O, feature engineering
โ”‚   โ””โ”€โ”€ deploy/             # FastAPI + Docker generation
โ”œโ”€โ”€ tests/                  # 106 unit tests + 3 integration tests
โ”œโ”€โ”€ configs/                # 5 example YAML configs
โ””โ”€โ”€ pyproject.toml          # Package config

๐Ÿ“ฆ Installation Options

# Core (minimal)
pip install open-mlpipe

# With CatBoost
pip install open-mlpipe[catboost]

# With MLflow tracking
pip install open-mlpipe[mlflow]

# With deployment (FastAPI + Docker)
pip install open-mlpipe[deploy]

# Everything
pip install open-mlpipe[full]

๐Ÿงช Testing

# Run all tests
pytest tests/

# Run unit tests only
pytest tests/ -m "not slow"

# Run with coverage
pytest tests/ --cov=open_mlpipe

๐Ÿค Contributing

Contributions welcome! Please:

  1. Fork the repo
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“„ License

MIT License โ€” see LICENSE for details.


๐Ÿ”— Links

Resource Link
Website open-mlpipe.onrender.com
Documentation loisekk.github.io/open-mlpipe
PyPI pypi.org/project/open-mlpipe
Issues github.com/loisekk/open-mlpipe/issues

Built with โค๏ธ by Yash Brahmankar

If this saved you time, โญ star the repo and share it!

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

open_mlpipe-1.0.4.tar.gz (100.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

open_mlpipe-1.0.4-py3-none-any.whl (44.8 kB view details)

Uploaded Python 3

File details

Details for the file open_mlpipe-1.0.4.tar.gz.

File metadata

  • Download URL: open_mlpipe-1.0.4.tar.gz
  • Upload date:
  • Size: 100.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for open_mlpipe-1.0.4.tar.gz
Algorithm Hash digest
SHA256 0e65a5b27e8f22114c907fb5c47d1796986134d2e50dda29a031031570f49251
MD5 42e62a42a01a8de501d980ccb2e26fe6
BLAKE2b-256 65e527c62f20937e67825bd8fa55272e7fad7dd64e8b34b4cf877018058bd547

See more details on using hashes here.

File details

Details for the file open_mlpipe-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: open_mlpipe-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 44.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for open_mlpipe-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3912adf3ebfb43076ad5115e1a323a985a4cf35581484b45436087d386f80735
MD5 8d345407ec668e492cec5aaacfc09c46
BLAKE2b-256 873ccda7e507aef315e3164cbc59ddecd356485e87a084086dc11a184bc183e0

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