spires_opt_score
Struct controlling how the optimizer scores candidate reservoir configurations.
Definition
enum spires_metric_kind { SPIRES_METRIC_AUROC = 0, SPIRES_METRIC_AUPRC = 1 };
struct spires_opt_score {
double lambda_var;
double lambda_cost;
int metric;
int _reserved_i0;
};Fields
| Field | Type | Description |
|---|---|---|
lambda_var | double | Penalty weight for cross-seed variance. The composite score is reduced by lambda_var * metric_std, where metric_std is the standard deviation of the metric across seeds. Higher values favor configurations with stable, reproducible performance. Must be non-negative. Typical range: 0.0 — 1.0. |
lambda_cost | double | Penalty weight for computational cost. The composite score is reduced by lambda_cost * relative_cost, where relative_cost is proportional to num_neurons. Higher values favor smaller, cheaper reservoirs. Must be non-negative. Typical range: 0.0 — 0.1. |
metric | int | Performance metric to optimize. Use one of the spires_metric_kind values: SPIRES_METRIC_AUROC (0) for Area Under the Receiver Operating Characteristic curve, or SPIRES_METRIC_AUPRC (1) for Area Under the Precision-Recall Curve. |
_reserved_i0 | int | Reserved for future use. Must be set to 0. |
Composite Score Formula
The optimizer ranks candidates by:
score = metric_mean - lambda_var * metric_std - lambda_cost * relative_costwhere:
metric_meanis the average of the selected metric across all seeds in a budget stage.metric_stdis the standard deviation across seeds.relative_costis a normalized measure of reservoir size (proportional tonum_neurons).
Example
/* Optimize AUROC with moderate variance penalty, low cost penalty */
struct spires_opt_score score = {
.lambda_var = 0.1,
.lambda_cost = 0.01,
.metric = SPIRES_METRIC_AUROC
};/* Optimize AUPRC for imbalanced datasets, no cost penalty */
struct spires_opt_score score = {
.lambda_var = 0.2,
.lambda_cost = 0.0,
.metric = SPIRES_METRIC_AUPRC
};Notes
- AUROC vs. AUPRC. AUROC is appropriate when positive and negative classes are roughly balanced. For highly imbalanced datasets (e.g., rare-event detection), AUPRC provides a more informative measure because it is sensitive to precision at low recall.
- Setting lambda_var to 0. Disables the variance penalty. The optimizer will select the configuration with the highest mean metric, regardless of how much performance varies across random seeds.
- Setting lambda_cost to 0. Disables the cost penalty. The optimizer will not penalize larger reservoirs, which may lead to selecting configurations with many neurons.
- Reserved fields. Always zero-initialize
_reserved_i0.
See Also
- spires_optimize — consumes this struct.
- spires_opt_budget — budget stage configuration.
- spires_opt_result — result struct containing the final scores.
- Scoring Metrics — practical guidance on metric selection.
Last updated on