Complete the code to start tracking an experiment run using MLflow.
with mlflow.start_run() as [1]: mlflow.log_param("learning_rate", 0.01)
The variable run is commonly used to represent the active experiment run context in MLflow.
Complete the code to log a metric called 'accuracy' with value 0.95 in MLflow.
mlflow.log_metric("accuracy", [1])
The metric value 0.95 matches the accuracy we want to log.
Fix the error in the code to set the experiment name before starting a run.
mlflow.[1]("MyExperiment") with mlflow.start_run(): mlflow.log_param("batch_size", 32)
The correct MLflow function to set the experiment name is set_experiment.
Fill both blanks to create a dictionary of parameters and log them in MLflow.
params = {"epochs": [1], "dropout": [2]
mlflow.log_params(params)The parameters dictionary uses 10 epochs and 0.3 dropout rate as values.
Fill all three blanks to filter experiment runs with accuracy greater than 0.9.
runs = mlflow.search_runs(filter_string="metrics.accuracy [1] [2]") high_acc_runs = [run for run in runs.itertuples() if run.metrics_accuracy [3] 0.9]
The filter string uses '>' and the threshold 0.9 to find runs with accuracy greater than 0.9.