Choose objective metrics
An objective pairs a numeric metric with a direction: Maximize when higher is better, or Minimize when lower is better. Your program calculates the metric; the experiment configuration tells HyperOptimizer how to use it.
Match the reported metric
Section titled “Match the reported metric”For a program that prints:
hpo.metrics.validation_loss=0.182hpo.metrics.duration_seconds=42.1configure validation_loss as Minimize. Names are case-sensitive and must match exactly. Every configured objective must be reported as a finite number by each successful trial. See report metrics.
Objectives versus supporting metrics
Section titled “Objectives versus supporting metrics”| Metric | Possible direction | What to check |
|---|---|---|
| Validation loss | Minimize | Use a fixed validation dataset. |
| Validation accuracy | Maximize | Keep the measurement scale consistent. |
| Runtime in seconds | Minimize | Use comparable machines and evaluation conditions. |
| Simulation error | Minimize | Define the reference outcome and error units. |
| Backtest drawdown | Minimize | Keep time windows and execution assumptions consistent. |
You can print more metrics than you optimize. Sample count, runtime, or memory use can help explain a result without becoming objectives. Supporting metrics do not automatically filter trials or enforce constraints.
Multiple objectives
Section titled “Multiple objectives”Use multiple objectives when you want to examine a tradeoff, such as accuracy and runtime. Each retains its own maximize/minimize direction. HyperOptimizer does not assign an implicit primary metric, weight the metrics, or declare a single overall winner.
For a single ranking, calculate a composite metric in your workload and document its weights and units. Otherwise, compare the metrics independently in the results. Check sampler compatibility before launching.
Goals and stopping conditions
Section titled “Goals and stopping conditions”Optional objective goals and conditions can stop an experiment when one trial meets all configured targets. Metrics from different trials do not combine to satisfy the goal. Meeting a target stops the search; it does not prove the result generalizes beyond the evaluation.
Avoid misleading scores
Section titled “Avoid misleading scores”Use actual evaluation output. Do not replace missing values with zero, mix units between runs, or rank a failed computation as a successful result. For stochastic workloads, validate promising configurations with additional runs.
Next: read and compare results or check the metric format reference.