Runs opvragen

Introductie tot MLflow

Weston Bassler

Senior MLOps Engineer

Modelgegevens

data

1 istock.com
Introductie tot MLflow

Run-gegevens

runs-data

Introductie tot MLflow

Runs zoeken

mlflow.search_runs()

pandas

1 https://pandas.pydata.org/
Introductie tot MLflow

Uitvoerformaat

 #   Column                         Non-Null Count  Dtype
 0   run_id                         6 non-null      object
 1   experiment_id                  6 non-null      object
 2   status                         6 non-null      object
 3   artifact_uri                   6 non-null      object
 4   start_time                     6 non-null      datetime64[ns, UTC]
 5   end_time                       5 non-null      datetime64[ns, UTC]
 6   metrics.test                   1 non-null      float64
 7   metrics.metric_2               3 non-null      float64
 8   metrics.metric_1               3 non-null      float64
 9   params.param_1                 3 non-null      object
 10  params.random_state            3 non-null      object
 11  params.n_estimators            3 non-null      object
 12  tags.mlflow.user               6 non-null      object
 13  tags.mlflow.runName            6 non-null      object
 14  tags.mlflow.source.type        6 non-null      object
 15  tags.mlflow.source.name        6 non-null      object
 16  tags.mlflow.log-model.history  3 non-null      object
dtypes: datetime64[ns, UTC](2), float64(3), object(12)
geheugengebruik: 944,0+ bytes
Introductie tot MLflow

Run-zoekopdrachten filteren

  • max_results - maximaal aantal resultaten.

  • order_by - kolom(men) om te sorteren in ASC of DESC.

  • filter_string - query als string.

  • experiment_names - naam/namen van experimenten.

Introductie tot MLflow

Tracking-UI

tracking-ui

Introductie tot MLflow

Voorbeeld: runs zoeken

import mlflow

# Filter string f1_score_filter = "metrics.f1_score > 0.60"
# Search runs mlflow.search_runs(experiment_names=["Insurance Experiment"], filter_string=f1_score_filter, order_by=["metrics.precision_score DESC"])
Introductie tot MLflow

Voorbeelduitvoer

# Search runs from Insurance Experiment
mlflow.search_runs(experiment_names=["Insurance Experiment"],
    filter_string=f1_score_filter, 
    order_by=["metrics.precision_score DESC"])
                             run_id experiment_id  ... tags.mlflow.source.type tags.mlflow.user
0  90407e29a5aa4a31954bed874c7d4337            27  ...                   LOCAL           user
1  c335c0b16a5d4cf398aaa7189362b577            27  ...                   LOCAL           user

Introductie tot MLflow

Laten we oefenen!

Introductie tot MLflow

Preparing Video For Download...