|
Algorithm 3 The Grid Search algorithm for fine-tuning the models. |
Input: Vector of n sets of parameters P, for a specific classification algorithm a. Scoring function s that is to be maximized. Output: Set of parameters p that produces the highest value for s
|
-
1:
param_combinations ← CartesianProduct(P)
-
2:
maximal_score ← −∞
-
3:
best_params ← None
-
4:
for p ∈ param_combinations do
-
5:
-
6:
-
7:
if score > maximal_score then
-
8:
maximal_score ← score
-
9:
maximal_params ← p
-
10:
end if
-
11:
end for
-
12:
return best_params
|