Skip to content

Commit

Permalink
bugfix: Process result files of the form (metric, value) as dictionar…
Browse files Browse the repository at this point in the history
…ies or scalar with the column name score (microsoft#460)

The LocalEnv.run() function processed any results DataFrame containing a
single record as a scalar record. This change ensures that even if the
result file contains a single line of the form `(metric, value)`, it is
processed as a dictionary.

---------

Co-authored-by: Sergiy Matusevych <sergiy.matusevych@gmail.com>
  • Loading branch information
poojanilangekar and motus authored Jul 28, 2023
1 parent 755950c commit 3b9fd29
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mlos_bench/mlos_bench/environments/local/local_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def run(self) -> Tuple[Status, Optional[dict]]:
self._read_results_file, extra_paths=[temp_dir]))

_LOG.debug("Read data:\n%s", data)
if len(data) != 1:
if list(data.columns) == ["metric", "value"]:
_LOG.warning(
"Local run has %d rows: assume long format of (metric, value)", len(data))
data = pandas.DataFrame([data.value.to_list()], columns=data.metric.to_list())
Expand Down

0 comments on commit 3b9fd29

Please sign in to comment.