From 47535ba53096f66cc99fb088b478304d55564f29 Mon Sep 17 00:00:00 2001 From: chaosyu Date: Wed, 14 Jul 2021 18:55:58 +0800 Subject: [PATCH] add mlflow filter string support to limit too much run number --- qlib/workflow/exp.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qlib/workflow/exp.py b/qlib/workflow/exp.py index 627b5ff82..63ab3ce40 100644 --- a/qlib/workflow/exp.py +++ b/qlib/workflow/exp.py @@ -325,7 +325,7 @@ class MLflowExperiment(Experiment): UNLIMITED = 50000 # FIXME: Mlflow can only list 50000 records at most!!!!!!! - def list_recorders(self, max_results: int = UNLIMITED, status: Union[str, None] = None): + def list_recorders(self, max_results: int = UNLIMITED, status: Union[str, None] = None, filter_string: str=""): """ Parameters ---------- @@ -334,8 +334,10 @@ class MLflowExperiment(Experiment): status : str the criteria based on status to filter results. `None` indicates no filtering. + filter_string : str + mlflow supported filter string like 'params."my_param"="a" and tags."my_tag"="b"', use this will help to reduce too much run number. """ - runs = self._client.search_runs(self.id, run_view_type=ViewType.ACTIVE_ONLY, max_results=max_results) + runs = self._client.search_runs(self.id, run_view_type=ViewType.ACTIVE_ONLY, max_results=max_results, filter_string=filter_string) recorders = dict() for i in range(len(runs)): recorder = MLflowRecorder(self.id, self._uri, mlflow_run=runs[i])