saealib.SklearnRFCClassificationSurrogate#
- class saealib.SklearnRFCClassificationSurrogate(**kwargs)[source]#
Bases:
SklearnClassificationSurrogateRandom Forest Classification surrogate.
Convenience wrapper around
SklearnClassificationSurrogateusingsklearn.ensemble.RandomForestClassifier.- Parameters:
**kwargs (object) – Keyword arguments forwarded to
sklearn.ensemble.RandomForestClassifier.
Methods
Return the surrogate model contract. |
|
Fit the classifier. |
|
Post-fit lifecycle hook; override to inject custom processing. |
|
Delegate to |
|
Return class-1 probability estimates. |
|
Return a copy of this surrogate with |
Method Details
- SklearnRFCClassificationSurrogate.__init__(**kwargs)[source]#
- Parameters:
kwargs (object)
- Return type:
None
- SklearnRFCClassificationSurrogate.contract()#
Return the surrogate model contract.
- Return type:
- SklearnRFCClassificationSurrogate.fit(train_x, train_y)#
Fit the classifier.
- Parameters:
train_x (np.ndarray) – Training input data. shape: (n_samples, n_features)
train_y (np.ndarray) – Binary labels. shape: (n_samples,), values in
{0, 1}.
- Return type:
None
- SklearnRFCClassificationSurrogate.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
- SklearnRFCClassificationSurrogate.predict(test_x)#
Delegate to
predict_proba.- Parameters:
test_x (ndarray)
- Return type:
- SklearnRFCClassificationSurrogate.predict_proba(test_x)#
Return class-1 probability estimates.
- Parameters:
test_x (np.ndarray) – Input data. shape: (n_samples, n_features) or (n_features,)
- Returns:
valueshape:(n_samples, 1), values in[0, 1].- Return type: