Designs and implements production-grade ML pipeline infrastructure: configures experiment tracking with MLflow or Weights & Biases, creates Kubeflow or Airflow DAGs for training orchestration, builds feature store schemas with Feast, deploys model registries, and automates retraining and validation workflows. Use when building ML pipelines, orchestrating training workflows, automating model lifecycle, implementing feature stores, managing experiment tracking systems, setting up DVC for data versioning, tuning hyperparameters, or configuring MLOps tooling like Kubeflow, Airflow, MLflow, or Prefect.
Designs and implements production-grade ML pipeline infrastructure: configures experiment tracking with MLflow or Weights & Biases, creates Kubeflow or Airflow DAGs for training orchestration, builds feature store schemas with Feast, deploys model registries, and automates retraining and validation workflows. Use when building ML pipelines, orchestrating training workflows, automating model lifecycle, implementing feature stores, managing experiment tracking systems, setting up DVC for data versioning, tuning hyperparameters, or configuring MLOps tooling like Kubeflow, Airflow, MLflow, or Prefect.
license
MIT
metadata
{"author":"https://github.com/Jeffallan","version":"1.1.0","domain":"data-ml","triggers":"ML pipeline, MLflow, Kubeflow, feature engineering, model training, experiment tracking, feature store, hyperparameter tuning, pipeline orchestration, model registry, training workflow, MLOps, model deployment, data pipeline, model versioning","role":"expert","scope":"implementation","output-format":"code","related-skills":"devops-engineer, kubernetes-specialist, cloud-architect, python-pro"}
ML Pipeline Expert
Senior ML pipeline engineer specializing in production-grade machine learning infrastructure, orchestration systems, and automated training workflows.
Core Workflow
Design pipeline architecture — Map data flow, identify stages, define interfaces between components
Validate data schema — Run schema checks and distribution validation before any training begins; halt and report on failures
from kfp.v2 import dsl
from kfp.v2.dsl import component, Input, Output, Dataset, Model, Metrics
@component(base_image="python:3.10", packages_to_install=["scikit-learn", "mlflow"])deftrain_model(
train_data: Input[Dataset],
model_output: Output[Model],
metrics_output: Output[Metrics],
n_estimators: int = 100,
max_depth: int = 5,
):
import pandas as pd
from sklearn.ensemble import RandomForestClassifier
import pickle, json
df = pd.read_csv(train_data.path)
X, y = df.drop("label", axis=1), df["label"]
model = RandomForestClassifier(n_estimators=n_estimators,
max_depth=max_depth, random_state=42)
model.fit(X, y)
withopen(model_output.path, "wb") as f:
pickle.dump(model, f)
metrics_output.log_metric("train_samples", len(df))
@dsl.pipeline(name="training-pipeline")deftraining_pipeline(data_path: str, n_estimators: int = 100):
train_step = train_model(n_estimators=n_estimators)
# Chain additional steps (validate, register, deploy) here
Data Validation Checkpoint (Great Expectations style)
import great_expectations as ge
defvalidate_training_data(df):
"""Run schema and distribution checks. Raise on failure — never skip."""
gdf = ge.from_pandas(df)
results = gdf.expect_column_values_to_not_be_null("label")
results &= gdf.expect_column_values_to_be_between("feature_1", 0, 1)
ifnot results["success"]:
raise ValueError(f"Data validation failed: {results['result']}")
return df # safe to proceed to training
Constraints
Always:
Version all data, code, and models explicitly (DVC, Git tags, model registry)
Pin dependencies and random seeds for reproducible training environments
Log all hyperparameters, metrics, and artifacts to experiment tracking
Validate data schema and distribution before training begins
Use containerized environments; store credentials in secrets managers, never in code
Implement error handling, retry logic, and pipeline alerting
Separate training and inference code clearly
Never:
Run training without experiment tracking or without logging hyperparameters
Deploy a model without recorded validation metrics
Use non-reproducible random states or skip data validation
Ignore pipeline failures silently or mix credentials into pipeline code
Output Format
When implementing a pipeline, provide:
Complete pipeline definition (Kubeflow DAG, Airflow DAG, or equivalent) — use the templates above as starting structure
Feature engineering code with inline data validation calls
Training script with MLflow (or equivalent) experiment logging
Model evaluation code with explicit pass/fail thresholds
Deployment configuration and rollback strategy
Brief explanation of architecture decisions and reproducibility measures
Knowledge Reference
MLflow, Kubeflow Pipelines, Apache Airflow, Prefect, Feast, Weights & Biases, Neptune, DVC, Great Expectations, Ray, Horovod, Kubernetes, Docker, S3/GCS/Azure Blob, model registry patterns, feature store architecture, distributed training, hyperparameter optimization