Complete the code to log a parameter using MLflow.
mlflow.log_param("learning_rate", [1])
The log_param function expects the parameter value, here a float 0.01 is correct.
Complete the code to log a metric named 'accuracy' with a value of 0.95.
mlflow.log_metric("accuracy", [1])
The log_metric function expects a numeric value for the metric, so 0.95 is correct.
Fix the error in logging a parameter where the variable 'lr' holds the learning rate.
mlflow.log_param("learning_rate", [1])
The variable lr holds the value to log, so it should be passed directly without quotes.
Fill both blanks to log a metric 'f1_score' with value stored in variable 'score'.
mlflow.log_metric([1], [2])
The metric name must be a string, so "f1_score" is correct. The value is the variable score.
Fill all three blanks to log parameters and metrics in a run.
with mlflow.start_run(): mlflow.log_param("batch_size", [1]) mlflow.log_metric("accuracy", [2]) mlflow.log_metric("loss", [3])
Parameters and metrics are logged with their values: batch size as integer 32, accuracy and loss as floats 0.89 and 0.12 respectively.