saealib.PerObjectiveSurrogate#
- class saealib.PerObjectiveSurrogate(surrogates)[ソース]#
ベースクラス:
RegressionSurrogateAssigns a different surrogate model to each objective function.
Each surrogate in
surrogatesis fitted on the corresponding column oftrain_y. Predictions are concatenated along the objective axis.If every surrogate has
provides_uncertainty = True, the returnedSurrogatePrediction.stdis populated by stacking each surrogate'sstdoutput; otherwisestdisNone.- パラメータ:
surrogates (list[Surrogate]) -- One surrogate per objective. Must be non-empty.
- 例外:
ValueError -- If
surrogatesis empty, or if the number of objectives intrain_ydoes not matchlen(surrogates)at fit time.
Methods
Return the surrogate model contract. |
|
Fit each surrogate on its corresponding objective column. |
|
Post-fit lifecycle hook; override to inject custom processing. |
|
Predict by combining each surrogate's output. |
|
Return a copy of this surrogate with |
Method Details
- PerObjectiveSurrogate.contract()#
Return the surrogate model contract.
- 戻り値の型:
- PerObjectiveSurrogate.fit(train_x, train_y)[ソース]#
Fit each surrogate on its corresponding objective column.
- パラメータ:
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,).
- 戻り値の型:
None
- PerObjectiveSurrogate.post_fit(train_x, train_y, ctx=None)#
Post-fit lifecycle hook; override to inject custom processing.
- パラメータ:
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.
- 戻り値の型:
None
- PerObjectiveSurrogate.predict(test_x)[ソース]#
Predict by combining each surrogate's output.
- パラメータ:
test_x (np.ndarray) -- Input data. shape: (n_samples, n_features) or (n_features,)
- 戻り値:
prediction.value shape: (n_samples, n_obj) prediction.std shape: (n_samples, n_obj) if all surrogates provide uncertainty, otherwise None. prediction.x holds the (n_samples, n_features) query points passed to this call, set directly from
test_xregardless of whether the wrapped surrogates populate their ownx(needed by acquisition functions such as CORSDistance).- 戻り値の型: