0% found this document useful (0 votes)
2 views

ML Tools - MLflow

MLflow is an open-source platform designed to streamline the machine learning lifecycle by providing tools for experiment tracking, model packaging, deployment, and model registry. It allows users to log parameters, metrics, and artifacts, manage model versions, and serve models with minimal setup. MLflow integrates with popular ML libraries and supports various deployment options, making it easier to transition from development to production.

Uploaded by

harshithr977
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

ML Tools - MLflow

MLflow is an open-source platform designed to streamline the machine learning lifecycle by providing tools for experiment tracking, model packaging, deployment, and model registry. It allows users to log parameters, metrics, and artifacts, manage model versions, and serve models with minimal setup. MLflow integrates with popular ML libraries and supports various deployment options, making it easier to transition from development to production.

Uploaded by

harshithr977
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

ML Tools

MLflow
Managing the Machine
Learning Lifecycle

Kostya Numan
AI & AGI Researcher
Why MLflow
Problem:
ML projects are chaotic - scattered code, untracked
experiments, unclear deployment steps.

Solution:
MLflow helps track, reproduce, and deploy models --
all from one place.

Covers Four Areas:


• Experiment tracking
• Model packaging
• Deployment
• Model registry

Open Source:
MLflow is framework-agnostic and integrates easily
with popular ML libraries.

Kostya Numan
AI & AGI Researcher
Tracking Experiments
MLflow Tracking lets you log parameters, metrics, tags,
and artifacts for each run.

What You Can Log:


• Hyperparameters and configs
• Evaluation metrics
• Training artifacts (models, plots, logs)
• Git commit or source code snapshot
UI Access:
Visualize runs in the MLflow web UI. Compare across
experiments easily.

Backend:
Stores data locally, on cloud storage, or in SQL-based
tracking servers.

Kostya Numan
AI & AGI Researcher
Logging From Code
Logging is as simple as wrapping your training code with
`mlflow.start_run()`.

Common Logging Calls:


• mlflow.log_param(...) for hyperparams
• mlflow.log_metric(...) for scores
• mlflow.log_artifact(...) for files
• mlflow.set_tag(...) for metadata
Auto-logging:
Supported for sklearn, Keras, XGBoost, LightGBM,
PyTorch Lightning.

Best Practice:
Group related logs in a single run with nested structure
if needed.

Kostya Numan
AI & AGI Researcher
Model Packaging
MLflow Models standardize how models are saved and
loaded across frameworks.

Supported Flavors:
• Python function (pyfunc)
• scikit-learn
• TensorFlow
• PyTorch
• XGBoost
Format:
Each model includes code, conda environment, and
signature for inputs/outputs.

Custom Logic:
Use pyfunc wrapper to add preprocessing or postproc-
essing logic.

Kostya Numan
AI & AGI Researcher
Model Registry
Central hub to manage lifecycle of models - staging,
versioning, approval, deployment.
Version Control:
Each model can have multiple versions tracked with
metadata and stage labels.

Stages:
Move models across Staging ’ Production ’ Archived.

Approval Workflows:
You can require reviews or tests before promoting a
model.

UI + API:
Manage registry via web UI or Python REST client.

Kostya Numan
AI & AGI Researcher
Serving Models
Serve MLflow models locally or in production with
minimal setup.
REST API:
`mlflow models serve` launches a local REST endpoint
from any saved model.

Scalability:
Integrate with Kubernetes, SageMaker, or Azure ML
for scale.

Monitoring:
Track inference logs and request payloads for
debugging and auditing.
Third-party platforms like BentoML or Ray Serve can
wrap MLflow models too.

Kostya Numan
AI & AGI Researcher
Artifacts and Storage
MLflow can log arbitrary files: checkpoints, images, logs,
configs.
Where Stored:
Artifacts can go to local disk, S3, GCS, Azure Blob, or
custom stores.

Use Case:
Save model files, attention heatmaps, training curves,
or evaluation CSVs.

Access:
Artifacts are linked per run and accessible from the UI
or API.

Kostya Numan
AI & AGI Researcher
Deployment Options
Where You Can Deploy:
• Local REST server
• Kubernetes
• SageMaker
• Azure ML
• Databricks
• Custom Docker containers
Environment Repro:
Each model export includes conda.yaml or requirem-
ents.txt to recreate the env.

CI/CD:
Integrate with GitHub Actions or Jenkins to automate
retraining and deployment.
MLflow makes it easier to go from notebook to
production without reinventing infra.

Kostya Numan
AI & AGI Researcher
Advanced Use Cases
What Power Users Do:
• Track hundreds of experiments at scale
• Use MLflow in Airflow DAGs
• Build custom MLflow plugins
• Sync with external registries
• Version data alongside models
Multi-user:
MLflow supports access control and multi-user
tracking setups.

Auditing:
Track who ran what, when, and with which config.

Kostya Numan
AI & AGI Researcher
Subscribe
to Numan Substack
for more insights

Kostya Numan
AI & AGI Researcher

You might also like