Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions mlos_bench/mlos_bench/optimizers/mlos_core_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ def name(self) -> str:
return f"{self.__class__.__name__}:{self._opt.__class__.__name__}"

def bulk_register(self,
configs: Sequence[dict],
scores: Sequence[Optional[Dict[str, TunableValue]]],
status: Optional[Sequence[Status]] = None) -> bool:
configs: Sequence[dict],
scores: Sequence[Optional[Dict[str, TunableValue]]],
status: Optional[Sequence[Status]] = None) -> bool:

if not super().bulk_register(configs, scores, status):
return False
Expand All @@ -104,6 +104,9 @@ def bulk_register(self,
df_scores = self._adjust_signs_df(
pd.DataFrame([{} if score is None else score for score in scores]))

# Convert all score columns to numeric, coercing errors to NaN
df_scores = df_scores.apply(pd.to_numeric, errors='coerce')

opt_targets = list(self._opt_targets)
if status is not None:
# Select only the completed trials, set scores for failed trials to +inf.
Expand All @@ -125,6 +128,7 @@ def bulk_register(self,

return True


def _adjust_signs_df(self, df_scores: pd.DataFrame) -> pd.DataFrame:
"""
In-place adjust the signs of the scores for MINIMIZATION problem.
Expand Down
2 changes: 1 addition & 1 deletion mlos_bench/mlos_bench/storage/sql/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class DbSchema:
# pylint: disable=too-many-instance-attributes

# Common string column sizes.
_ID_LEN = 512
_ID_LEN = 256
_PARAM_VALUE_LEN = 1024
_METRIC_VALUE_LEN = 255
_STATUS_LEN = 16
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"experiment_id": "MyExperimentName",
"config_id": 1,
"trial_id": 1,
"max_trials": 100
"max_trials": 200
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(self, *, # pylint: disable=too-many-locals,too-many-arguments
seed: Optional[int] = 0,
run_name: Optional[str] = None,
output_directory: Optional[str] = None,
max_trials: int = 100,
max_trials: int = 5000,
n_random_init: Optional[int] = None,
max_ratio: Optional[float] = None,
use_default_config: bool = False,
Expand Down