jijzepttools.blackbox_optimization.surrogate_model.interface#

This module provides a unified interface for surrogate models used in blackbox optimization. It includes parameter classes, abstract interface, and concrete implementations for Factorization Machine (FM) and Bayesian Optimization of Combinatorial Structures (BOCS).

Classes:
  • SurrogateModelParams: Base class for all surrogate model parameters

  • FMParams: Parameters for Factorization Machine

  • BOCSParams: Parameters for BOCS

  • SurrogateModel: Abstract base class for surrogate models

  • FMSurrogateModel: Factorization Machine implementation

  • BOCSSurrogateModel: BOCS implementation

Classes#

SurrogateModelParams

Base class for all surrogate model parameters.

SurrogateModel

Abstract base class for surrogate models in blackbox optimization.

Module Contents#

class SurrogateModelParams#

Base class for all surrogate model parameters.

This class serves as a base for parameter classes used by different surrogate models (e.g., FMParams, BOCSParams). Each concrete implementation should define the specific parameters needed for that model type.

This provides a unified interface for parameter classes of different surrogate models, allowing for type-safe and extensible parameter handling.

class SurrogateModel#

Bases: abc.ABC

Abstract base class for surrogate models in blackbox optimization.

This interface provides a unified way to interact with different surrogate models such as Factorization Machine and BOCS. The typical workflow is: 1. Instantiate a concrete surrogate model with parameters 2. Fit the model to observed data using fit() 3. Create optimization objective using create_optimization_model()

abstract fit(x: numpy.ndarray, y: numpy.ndarray) None#

Fit the surrogate model to observed data.

Parameters:
  • x (np.ndarray, shape (n_samples, n_features)) – Input features from blackbox function evaluations.

  • y (np.ndarray, shape (n_samples,)) – Target values for a single objective.

abstract surrogate_to_ommx_objective(decision_variables: list[ommx.v1.DecisionVariable])#

Create an OMMX expression representing the surrogate model objective.

Parameters:

decision_variables (list[ommx.v1.DecisionVariable]) – List of decision variables from the OMMX instance.