Flux de travail

Introduction à MLflow

Weston Bassler

Senior MLOps Engieer

Projets MLflow

Flux de travail

1 unsplash.com
Introduction à MLflow

MLproject

name: project_name
python_env: python_env.yaml
entry_points:

step_1: command: "python train_model.py"
step_2: command: "python evaluate_model.py {run_id}" parameters: run_id: type: str default: None
Introduction à MLflow

Flux de travail

import mlflow

# Étape 1
step_1 = mlflow.projects.run(
    uri='./',
    entry_point='step_1'
)

# Étape 2 step_2 = mlflow.projects.run( uri='./', entry_point='step_2' )
Introduction à MLflow

Exécution de projets

import mlflow

# Étape 1
step_1 = mlflow.projects.run(
    uri='./',
    entry_point='step_1'
)

print(step_1)
<mlflow.projects.submitted_run.LocalSubmittedRun object at 0x125eac8b0>
Introduction à MLflow

Exécution de projets

step_1.cancel() - Mettre fin à une exécution en cours

step_1.get_status() - Obtenir l'état d'une exécution

step_1.run_id - run_id de l'exécution

step_1.wait() - Attendre la fin de l'exécution

Introduction à MLflow

Exécution de projets

import mlflow

# Étape 1
step_1 = mlflow.projects.run(
    uri='./',
    entry_point='step_1'
)

# Définir une variable pour le run_id de step_1 step_1_run_id = step_1.run_id
# Étape 2
step_2 = mlflow.projects.run(
    uri='./',
    entry_point='step_2',

parameters={ 'run_id': step_1_run_id }
)
Introduction à MLflow

Cycle de vie des modèles

Conception et évaluation de modèles

Introduction à MLflow

Passons à la pratique !

Introduction à MLflow

Preparing Video For Download...