Explore Library
Code QuizAdvanced

Logging Metrics to a Run

Identify why the accuracy metric never attaches to the tracked run.

Codepython
import mlflow

def log_experiment(params, accuracy):
    with mlflow.start_run():
        mlflow.log_param("lr", params["lr"])
    mlflow.log_metric("accuracy", accuracy)

What is the bug in this experiment-logging code?