MLflow is the standard platform for experiment tracking and model management in data science teams.
Installation
pip install mlflow
mlflow ui
Browser: http://localhost:5000
Tracking API
import mlflow
mlflow.start_run()
mlflow.log_param("n_estimators", 100)
mlflow.log_metric("accuracy", 0.95)
mlflow.sklearn.log_model(model, "model")
mlflow.end_run()
Model Registry
mlflow.register_model(
"runs:/abc123/model",
"my-classifier"
)
# Promote to production
client = mlflow.tracking.MlflowClient()
client.transition_model_version_stage(
name="my-classifier",
version=1,
stage="Production"
)
Serving
mlflow models serve -m runs:/abc123/model -p 1234
