π MLflow Integration
Track experiments, log metrics, and manage models with MLflow's ecosystem integrated directly into FlowyML pipelines.
π Experiment Tracking π·οΈ Model Registry π Metric Logging
π§ͺ MLflow Integration
What you'll learn
How to auto-log metrics and models to MLflow β FlowyML + MLflow = automated experiment tracking with the industry-standard platform.
Track experiments, manage model versions, and deploy models using MLflow's open-source ecosystem.
Why MLflow?
| Feature | Benefit |
|---|---|
| Experiment Tracking | Log parameters, metrics, and artifacts |
| Model Registry | Version and manage model lifecycles |
| Universal | Works with any ML library |
| Open Source | No vendor lock-in |
π§ͺ Setup
Auto-Logging
Enable MLflow tracking for your pipeline:
from flowyml.integrations.mlflow import MLflowTracker
pipeline.run(
tracker=MLflowTracker(
tracking_uri="http://localhost:5000",
experiment_name="my_experiment",
)
)
MLflowTracker Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
tracking_uri |
str |
required | MLflow tracking server URL |
experiment_name |
str |
"default" |
Experiment name |
run_name |
str |
None |
Custom run name |
auto_log |
bool |
True |
Auto-log step params/metrics |
π Custom Logging in Steps
Log custom metrics, parameters, and artifacts:
import mlflow
from flowyml import step
@step
def train_model(data):
# Log parameters
mlflow.log_param("lr", 0.01)
mlflow.log_param("optimizer", "adam")
model = train(data, lr=0.01)
# Log metrics
mlflow.log_metric("accuracy", 0.95)
mlflow.log_metric("f1_score", 0.93)
# Log the model artifact
mlflow.sklearn.log_model(model, "model")
return model
π¦ Model Registry
Register and promote models through lifecycle stages:
@step
def register_best_model(model, metrics):
# Log and register in one step
mlflow.sklearn.log_model(model, "model", registered_model_name="ProductionModel")
# Promote to staging
client = mlflow.tracking.MlflowClient()
client.transition_model_version_stage(
name="ProductionModel",
version="1",
stage="Staging",
)
Best Practices
Use autolog for quick wins
mlflow.autolog() automatically captures sklearn, XGBoost, LightGBM, and PyTorch metrics β zero code changes needed.
Remote tracking server
In production, point tracking_uri to a shared MLflow server so your whole team can see experiment results.
π What's Next?
π Weights & Biases
Visualize training runs with interactive dashboards and team collaboration.
π Evaluations
Evaluate your models with built-in metrics, custom scorers, and comparison tools.
π Plugin System
Extend FlowyML with custom plugins for logging, tracking, and notifications.