src.environment.problem.SOO.HPO_B.hpo_b¶
Module Contents¶
Classes¶
Introduction¶HPO-B is an autoML hyper-parameter optimization benchmark which includes a wide range of hyperparameter optimization tasks for 16 different model types (e.g., SVM, XGBoost, etc.), resulting in a total of 935 problem instances. The dimension of these problem instances range from 2 to 16. We also note that HPO-B represents problems with ill-conditioned landscape such as huge flattern. |
API¶
- class src.environment.problem.SOO.HPO_B.hpo_b.HPOB_Problem(bst_surrogate, dim, y_min, y_max, lb, ub, normalized=False, name=None)[source]¶
Bases:
src.environment.problem.basic_problem.Basic_ProblemIntroduction¶
HPO-B is an autoML hyper-parameter optimization benchmark which includes a wide range of hyperparameter optimization tasks for 16 different model types (e.g., SVM, XGBoost, etc.), resulting in a total of 935 problem instances. The dimension of these problem instances range from 2 to 16. We also note that HPO-B represents problems with ill-conditioned landscape such as huge flattern.
Original paper¶
“Hpo-b: A large-scale reproducible benchmark for black-box hpo based on openml.” arXiv preprint arXiv:2106.06257 (2021).
Official Implementation¶
License¶
None
Initialization
Initializes the class with the provided surrogate model, dimensionality, bounds, and other configuration parameters.
Args:¶
bst_surrogate: The surrogate model to be used for optimization.
dim (int): The dimensionality of the problem.
y_min (float): The minimum value of the objective function.
y_max (float): The maximum value of the objective function.
lb (array-like): The lower bounds for each dimension.
ub (array-like): The upper bounds for each dimension.
normalized (bool, optional): Whether to normalize the input data. Defaults to False.
name (str, optional): The name of the problem instance. Defaults to None.
Built-in Attributes:¶
bst_surrogate: Stores the surrogate model.
y_min: Stores the minimum objective value.
y_max: Stores the maximum objective value.
dim: Stores the problem dimensionality.
gbest: Stores the global best value found so far.Defaults to 1e+10.
normalized: Indicates if normalization is applied.
collect_gbest: List to collect global best values during optimization.
lb: Stores the lower bounds.
ub: Stores the upper bounds.
optimum: Stores the optimum solution (if found).
name: Stores the name of the problem instance.
- func(position)[source]¶
Introduction¶
Evaluates the surrogate model prediction for a given position, normalizes the result, and updates the global best collection.
Args:¶
position (np.ndarray): The input position vector to be evaluated, expected to have shape compatible with (self.dim,).
Returns:¶
float: The negative normalized prediction from the surrogate model for the given position.
Side Effects:¶
Appends the current global best (
self.gbest) to theself.collect_gbestlist.
Notes:¶
Uses an XGBoost surrogate model (
self.bst_surrogate) for prediction.Normalization is performed using the
self.normalizemethod.
- normalize(y)[source]¶
Introduction¶
Normalizes the input array
yto the range [0, 1] based on the object’s normalization settings.Args:¶
y (np.ndarray or float): The input value(s) to be normalized.
Returns:¶
np.ndarray or float: The normalized value(s) if normalization is enabled; otherwise, returns the input as is.
Notes:¶
If
self.normalizedis True andself.y_minis None, normalization is performed using the min and max ofy.If
self.normalizedis True andself.y_minis set, normalization usesself.y_minandself.y_maxand clips the result to [0, 1].If
self.normalizedis False, the inputyis returned unchanged.