All problems
Grid Search Best Combination
Problem
Grid search evaluates every combination of two hyperparameters, recorded as a score matrix, and picks the entry with the lowest validation loss.
Given the score matrix, return [i, j] of the minimum, breaking ties toward the first row and column encountered.
Hint
Scan in row-major order with a strict less-than test.
Test cases
case 1
in: [[[1,2],[3,0.5]]]
expected: [1,1]
case 2
in: [[[4,3,5],[2,2,6]]]
expected: [1,0]
case 3
in: [[[1,1],[1,1]]]
expected: [0,0]
Starter codePython
def grid_search_best_combination(scores):
# Your code here
pass3 test cases · run your code against them in the editor