Objective Function
Each iteration consists of two steps:
- The optimization step: decides what position in the search space (parameter set) to evaluate next
- The evaluation step: calls the objective function, which returns the score for the given position in the search space
The objective function has one argument that is often called "para", "params", "opt" or "access". This argument is your access to the parameter set that the optimizer has selected in the corresponding iteration.
Example
Multiple Objectives
The objective function always needs a score, which shows how "good" or "bad" the current parameter set is. But you can also return some additional information with a dictionary:
Example
When you take a look at the results (a pandas dataframe with all iteration information) after the run has ended you will see the additional information in it. The reason we need a dictionary for this is because Hyperactive needs to know the names of the additonal parameters. The score does not need that, because it is always called "score" in the results.