Skip to content

Commit

Permalink
🚑 Fixed different combination length in grid search
Browse files Browse the repository at this point in the history
  • Loading branch information
albertnieto committed Sep 27, 2024
1 parent fc17d0f commit 65a641e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion qcml/bench/grid_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,17 @@ def _evaluate_combinations(
self.results = []
total_combinations = len(self.combinations)

for idx, (params, trans_func, trans_params) in enumerate(self.combinations):
for idx, combination in enumerate(self.combinations):
if len(combination) == 1:
params = combination[0]
trans_func = None
trans_params = None
elif len(combination) == 3:
params, trans_func, trans_params = combination
else:
logger.error(f"Invalid combination format: {combination}")
continue # Skip invalid combinations

try:
evaluation_result = self.evaluator.evaluate(
classifier,
Expand Down

0 comments on commit 65a641e

Please sign in to comment.