Searching experiment results
MLflow makes it simple to query the results of your experiments, helping you keep track of model performance and hyperparameters.
Let's examine your most recent experiment, finding the model with the lowest Mean Absolute Percentage Error (MAPE).
This exercise is part of the course
Designing Forecasting Pipelines for Production
Exercise instructions
- Search MLflow runs by the
experiment_name. - Get the single best-performing model from
all_resultsbased onmetrics.mape. - Print the subset of
best_mape_model.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
experiment_name = "hyperparameter_tuning"
# Query MLflow
all_results = mlflow.____(experiment_names=[____])
# Filter for the model with the best MAPE score
best_mape_model = all_results.____("metrics.mape").head(____)
# Print the model
print(____[["params.model_name", "metrics.mape"]])