Consigner des expériences avec MLflow

Machine Learning de bout en bout

Joshua Stapleton

Machine Learning Engineer

MLflow

Sans MLflow…

  • De nombreuses exécutions non suivies et désorganisées
  • Exécutions dissemblables ou incomparables
  • Exécutions non reproductibles, perdues

Avec MLflow…

  • Exécutions suivies et organisées
  • Comparaison entre exécutions standardisées
  • Exécutions reproductibles
  • Partager, déployer des modèles
Machine Learning de bout en bout

Créer des expériences

mlflow.set_experiment()

  • Définit le nom de l'expérience
  • Crée l'espace de travail des exécutions

 

Utilisation :

import mlflow

# Set an experiment name, which is a workspace for your runs
mlflow.set_experiment("Heart Disease Classification")
Machine Learning de bout en bout

Exécuter des expériences

# Start a new run in this experiment
with mlflow.start_run():
    # Train a model, get the prediction accuracy
    logistic_model = LogisticRegression()

# Log parameters, eg: mlflow.log_param("n_estimators", logistic_model.n_estimators)
# Log metrics (accuracy in this case) mlflow.log_metric("accuracy", logistic_model.accuracy)
# Print out metrics print("Model accuracy: %.3f" % accuracy)
Model accuracy: 0.96
Machine Learning de bout en bout

Récupérer des expériences

 

mlflow.get_run(run_id)

  • Métadonnées d'une exécution donnée

 

mlflow.search_runs()

  • Retourne un DataFrame d'indicateurs pour plusieurs exécutions

Utilisation :

# Fetch the run data and print params
run_data = mlflow.get_run(run_id)
print(run_data.data.params)
print(run_data.data.metrics)

# Search all runs in experiment
exp_id = run_data.info.experiment_id
runs_df = mlflow.search_runs(exp_id)
{'epochs': '20', 'accuracy': 0.95}
Machine Learning de bout en bout

Interface MLflow

 

Tableau de bord d'expériences MLflow

 

Page d'exemple d'expérience MLflow

Machine Learning de bout en bout

Interface MLflow (suite)

 

Graphique d'exemple montrant l'amélioration d'un indicateur

 

Exemple de comparaison d'indicateurs entre exécutions

Machine Learning de bout en bout

Ressources MLflow

  • Introduction à MLflow Introduction à MLflow
  • Site officiel de MLflow Site officiel de MLflow
Machine Learning de bout en bout

Passons à la pratique !

Machine Learning de bout en bout

Preparing Video For Download...