import mlflow with mlflow.start_run(run_name="my_run"): mlflow.log_metric("acc", 0.85) mlflow.log_metric("loss", 0.1)
import mlflow run_id = "a48ea805221f40e8a3e09b3cd25255e9" metric_key = "acc" metric_history = mlflow.search_runs(run_ids=run_id, filter_string=f"metrics.{metric_key} IS NOT NULL")In this example, we are querying the metric entity `acc` from a specific run using `mlflow.search_runs()`. We are fetching all the metric history for the run and storing it in a variable `metric_history`. The `mlflow.entities` module is one of the modules inside the MLflow package library.