Grid search¶
This section documents grid-based search utilities provided by eb-optimization.
Grid search utilities support systematic exploration of discrete parameter spaces when tuning optimization policies and decision thresholds.
eb_optimization.search.grid
¶
Grid construction utilities for optimization search spaces.
This module provides small, deterministic helpers for constructing bounded, interpretable parameter grids used by offline optimization routines.
Responsibilities: - Create numerically stable, reproducible grids for scalar parameters - Enforce positivity and boundary constraints - Standardize grid behavior across tuners
Non-responsibilities: - Evaluating objectives - Selecting optimal parameters - Performing any optimization logic
Design philosophy: This utility favors bounded, discrete search spaces for interpretability, auditability, and deployability of learned policies.
make_float_grid(x_min, x_max, step, decimals=10)
¶
Create a numerically robust 1D grid over a closed interval.
This utility is used throughout optimization to create bounded, interpretable candidate sets for discrete parameter search (e.g., uplift multipliers, thresholds).
The returned grid:
- starts at
x_min - increments by
step - includes
x_max(to the extent permitted by floating-point arithmetic) - is clipped and de-duplicated for numerical stability
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x_min
|
float
|
Lower bound for the grid (inclusive). Must be strictly positive. |
required |
x_max
|
float
|
Upper bound for the grid (inclusive). Must be greater than or equal to |
required |
step
|
float
|
Step size between candidates. Must be strictly positive. |
required |
decimals
|
int
|
Rounding precision used to stabilize floats and de-duplicate. |
10
|
Returns:
| Type | Description |
|---|---|
ndarray
|
A 1D array of unique grid values in ascending order. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Notes
This utility ensures reproducible and stable grid construction for parameter tuning and optimization purposes, while favoring discrete, bounded search spaces for interpretability and deployability.