saealib.SklearnSurrogate#
- class saealib.SklearnSurrogate(estimator)[ソース]#
ベースクラス:
RegressionSurrogateSurrogate adapter for scikit-learn compatible estimators.
Wraps any estimator that implements
fit(X, y)andpredict(X). Multi-objective problems are handled by fitting one cloned estimator per objective, following the same pattern asRBFSurrogate.- パラメータ:
estimator (sklearn estimator) -- A scikit-learn compatible regressor instance (e.g.
SVR()). The estimator is cloned once per objective on the firstfitcall.- 例外:
ImportError -- If scikit-learn is not installed.
Methods
Return the surrogate model contract. |
|
Fit the surrogate model. |
|
Post-fit lifecycle hook; override to inject custom processing. |
|
Predict using the surrogate model. |
|
Return a copy of this surrogate with |
Method Details
- SklearnSurrogate.contract()#
Return the surrogate model contract.
- 戻り値の型:
- SklearnSurrogate.fit(train_x, train_y)[ソース]#
Fit the surrogate model.
- パラメータ:
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
- SklearnSurrogate.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