saealib.RBFSurrogate#

class saealib.RBFSurrogate(kernel, polynomial_degree='auto', solver='lstsq', alpha=1e-08)[source]#

Bases: RegressionSurrogate

Radial Basis Function interpolation surrogate model.

Supports multi-objective problems with one independent model per objective. The number of objectives is inferred from train_y on the first call to fit.

Parameters:
  • kernel (RBFKernel)

  • polynomial_degree (Literal['auto', 0, 1] | None)

  • solver (str)

  • alpha (float)

kernel#

Kernel object (e.g. GaussianKernel()). Reassigning this property invalidates any fitted state; call fit() again before the next predict().

Type:

RBFKernel

n_features_in_#

Number of input features seen by the most recent successful fit(); None before the first successful fit.

Type:

int or None

n_obj#

Number of objectives. Set on first fit call.

Type:

int or None

polynomial_degree#

Configured polynomial degree. "auto" resolves from kernel.min_polynomial_degree and None disables the polynomial term.

Type:

{“auto”, None, 0, 1}

resolved_polynomial_degree#

Concrete polynomial degree used by the next or most recent fit.

Type:

int or None

resolved_kernel#

Kernel instance used by the most recent successful fit, or None before fitting.

Type:

RBFKernel or None

solver#

Linear system solver used during fitting.

Type:

str

alpha#

Tikhonov regularization strength.

Type:

float

References

Origin of RBF interpolation: Hardy (1971).

[16]: Gutmann, H.-M. (2001). A radial basis function method for global optimization. Journal of Global Optimization, 19(3), 201-227.

[17]: Regis, R. G., & Shoemaker, C. A. (2005). Constrained global optimization of expensive black box functions using radial basis functions. Journal of Global Optimization, 31(1), 153-171.

[18]: Rasmussen, C. E., & Williams, C. K. I. (2006). Gaussian processes for machine learning. MIT Press.

Methods

__init__

contract

Return the surrogate model contract.

fit

Fit the surrogate model.

post_fit

Post-fit lifecycle hook; override to inject custom processing.

predict

Predict using the surrogate model.

with_post_fit

Return a copy of this surrogate with fn appended to the post-fit hook.

Method Details

RBFSurrogate.__init__(kernel, polynomial_degree='auto', solver='lstsq', alpha=1e-08)[source]#
Parameters:
  • kernel (RBFKernel)

  • polynomial_degree (Literal['auto', 0, 1] | None)

  • solver (str)

  • alpha (float)

Return type:

None

RBFSurrogate.contract()#

Return the surrogate model contract.

Return type:

ComponentContract

RBFSurrogate.fit(train_x, train_y)[source]#

Fit the surrogate model.

Parameters:
  • train_x (np.ndarray) – Training input data. shape: (n_samples, n_features)

  • train_y (np.ndarray) – Training output data. shape: (n_samples, n_obj) or (n_samples,). 1-D input is treated as single-objective: shape (n_samples, 1).

Return type:

None

RBFSurrogate.post_fit(train_x, train_y, ctx=None)#

Post-fit lifecycle hook; override to inject custom processing.

Parameters:
  • train_x (np.ndarray) – Training input data used for this fit. shape: (n_samples, n_features)

  • train_y (np.ndarray) – Training output data used for this fit. shape: (n_samples, n_obj)

  • ctx (OptimizationState or None, optional) – Current optimization context.

Return type:

None

RBFSurrogate.predict(test_x)[source]#

Predict using the surrogate model.

Parameters:

test_x (np.ndarray) – Input data. shape: (n_samples, n_features) or (n_features,)

Returns:

prediction.value shape: (n_samples, n_obj) prediction.std is None (RBF interpolation provides no uncertainty) prediction.x holds the (n_samples, n_features) query points passed to this call (candidates when called from a prediction stage, holdout/archive points when called for accuracy evaluation), needed by acquisition functions that have no other channel to the points being scored (e.g. CORSDistance).

Return type:

SurrogatePrediction

Raises:

RuntimeError – If the surrogate has not been fitted, or kernel was reassigned since the last fit() call.

RBFSurrogate.with_post_fit(fn)#

Return a copy of this surrogate with fn appended to the post-fit hook.

Parameters:

fn (callable) – fn(train_x, train_y, ctx) -> None

Returns:

Shallow copy with the hook registered.

Return type:

Surrogate