1. A senior data scientist wants to programmatically retrieve all MLflow runs in an experiment that achieved a validation AUC greater than 0.90 and used a max_depth parameter of 6, then sort them by AUC descending. Which MlflowClient code snippet correctly accomplishes this?
- A. client.search_runs(experiment_ids=['123'], filter_string="metrics.val_auc > 0.90 and params.max_depth = '6'", order_by=['metrics.val_auc DESC'])✓ Correct
- B. client.search_runs(experiment_ids=['123'], filter_string="metrics.val_auc > 0.90 and params.max_depth = 6", order_by=['metrics.val_auc DESC'])
- C. client.list_runs(experiment_id='123', filter_string="metrics.val_auc > 0.90", params={'max_depth': 6}, sort_by='val_auc')
- D. client.get_experiment('123').runs.filter(val_auc__gt=0.90, max_depth=6).order_by('-val_auc')
Explanation
Option A is correct: in MLflow's search_runs() filter syntax, parameter values must be compared as strings (quoted), even if they represent numbers, while metric values are compared as numeric literals. The filter string "metrics.val_auc > 0.90 and params.max_depth = '6'" correctly uses the string comparison for the param and numeric comparison for the metric. The order_by list with 'metrics.val_auc DESC' correctly sorts results. Option B is incorrect because params.max_depth = 6 uses a numeric literal for a parameter, but all parameter values in MLflow are stored as strings; this will raise a query parsing error. Option C is incorrect because MlflowClient has no list_runs() method with those arguments; the correct method is search_runs(). Option D is incorrect; MlflowClient does not expose a Django ORM-style queryset API — it does not have .filter() or .order_by() chaining methods on experiment objects.