Introducere în MLflow Model Registry

Introducere în MLflow

Weston Bassler

Senior MLOps Engineer

Ciclul de viață al modelului

Diagramă de dezvoltare și testare

Introducere în MLflow

MLflow Model Registry

  • Locație centralizată de stocare

  • Gestionarea ciclului de viață

    • Interfață web UI
    • Modulul MLflow Client
    • Versiuni de model
    • Etape ale modelului

model-registry

Introducere în MLflow

MLflow Model Registry

  • Model

    • Model înregistrat în MLflow Tracking
  • Model înregistrat

    • Primește versiune
    • Eligibil pentru etapă
Introducere în MLflow

MLflow Model Registry

  • Versiune de model

    • Se incrementează la fiecare model nou înregistrat
  • Etapă a modelului

    • Poate fi una dintre:
      • None
      • Staging
      • Production
      • Archived

Etape

Introducere în MLflow

Lucrul cu Model Registry

Modele

Introducere în MLflow

Modulul MLflow Client

  • Experimente

  • Rulări

  • Versiuni de model

  • Modele înregistrate

Învățare automată

1 Flaticon.com
Introducere în MLflow

Utilizarea modulului MLflow Client

# Import from MLflow module
from mlflow import MlflowClient


# Create an instance client = MlflowClient()
# Print the object client
<mlflow.tracking.client.MlflowClient object at 0x101d55f30>
Introducere în MLflow

Înregistrarea unui model

# Create a Model named "Unicorn"
client.create_registered_model(name="Unicorn")
<RegisteredModel: creation_timestamp=1679404160448, description=None, 
last_updated_timestamp=1679404160448, latest_versions=[], name='Unicorn', 
tags={}>
Introducere în MLflow

Interfața UI a modelului

creare-model

Introducere în MLflow

Căutarea modelelor înregistrate

căutare-modele

Introducere în MLflow

Căutarea modelelor înregistrate

# Search for registered models
client.search_registered_models(filter_string=MY_FILTER_STRING)
  • Identificatori
    • name - numele modelului
    • tags - etichete asociate modelului
  • Operatori de comparație
    • = - egal cu
    • != - diferit de
    • LIKE - potrivire cu majuscule
    • ILIKE - potrivire fără distincție majuscule
Introducere în MLflow

Exemplu de căutare

# Filter string
unicorn_filter_string = "name LIKE 'Unicorn%'"


# Search models client.search_registered_models(filter_string=unicorn_filter_string)
[<RegisteredModel: creation_timestamp=1679404160448, description=None, 
last_updated_timestamp=1679404160448, latest_versions=[], name='Unicorn', 
tags={}>, 
<RegisteredModel: creation_timestamp=1679404276745, description=None, 
last_updated_timestamp=1679404276745, latest_versions=[], name='Unicorn 2.0', 
tags={}>]
Introducere în MLflow

Să exersăm!

Introducere în MLflow

Preparing Video For Download...