Skip to content

Commit

Permalink
Fix bug with categoricals in TSEMO (#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosfelt authored Jun 12, 2023
1 parent 7fe4d50 commit 8b987de
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions summit/strategies/tsemo.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,11 @@ def suggest_experiments(self, num_experiments, prev_res: DataSet = None, **kwarg
)

# NSGAII internal optimisation on spectrally sampled functions
self.logger.info("Optimizing models using NSGAII.")
self.logger.info("Optimizing acquisition function")

# Categorical only domain
if (self.domain.num_continuous_dimensions() == 0) and (
self.domain.num_categorical_variables() == 1
self.domain.num_categorical_variables() == len(self.domain.input_variables)
):
X, yhat = self._categorical_enumerate(self.models)
# Mixed domains
Expand All @@ -238,6 +238,8 @@ def suggest_experiments(self, num_experiments, prev_res: DataSet = None, **kwarg
# Continous domains
elif self.categorical_combos is None and len(self.input_columns) > 0:
X, yhat = self._nsga_optimize(self.models)
else:
raise ValueError("No valid domain found.")

# Return if no suggestiosn found
if X.shape[0] == 0 and yhat.shape[0] == 0:
Expand Down

0 comments on commit 8b987de

Please sign in to comment.