Skip to main content
. 2025 Jul 1;25(13):4111. doi: 10.3390/s25134111
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:

      modela(p)

  •   6:

      scores(model)

  •   7:

      if  score > maximal_score then

  •   8:

        maximal_score ← score

  •   9:

        maximal_params ← p

  •  10:

      end if

  •  11:

    end for

  •  12:

    return best_params