saealib.SklearnSVCClassificationSurrogate#

class saealib.SklearnSVCClassificationSurrogate(**kwargs)[ソース]#

ベースクラス: SklearnClassificationSurrogate

Support Vector Classification surrogate.

Convenience wrapper around SklearnClassificationSurrogate using sklearn.svm.SVC(probability=True).

パラメータ:

**kwargs (object) -- Keyword arguments forwarded to sklearn.svm.SVC. probability=True is always set.

Methods

__init__

contract

Return the surrogate model contract.

fit

Fit the classifier.

post_fit

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

predict

Delegate to predict_proba.

predict_proba

Return class-1 probability estimates.

with_post_fit

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

Method Details

SklearnSVCClassificationSurrogate.__init__(**kwargs)[ソース]#
パラメータ:

kwargs (object)

戻り値の型:

None

SklearnSVCClassificationSurrogate.contract()#

Return the surrogate model contract.

戻り値の型:

ComponentContract

SklearnSVCClassificationSurrogate.fit(train_x, train_y)#

Fit the classifier.

パラメータ:
  • 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}.

戻り値の型:

None

SklearnSVCClassificationSurrogate.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

SklearnSVCClassificationSurrogate.predict(test_x)#

Delegate to predict_proba.

パラメータ:

test_x (ndarray)

戻り値の型:

SurrogatePrediction

SklearnSVCClassificationSurrogate.predict_proba(test_x)#

Return class-1 probability estimates.

パラメータ:

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

戻り値:

value shape: (n_samples, 1), values in [0, 1].

戻り値の型:

SurrogatePrediction

SklearnSVCClassificationSurrogate.with_post_fit(fn)#

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

パラメータ:

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

戻り値:

Shallow copy with the hook registered.

戻り値の型:

Surrogate