RandomSearchClassifierPE#

class capymoa.stream.preprocessing.RandomSearchClassifierPE[source]#

Bases: ClassifierPipelineElement, Classifier

__init__(
classifier_class: Classifier,
hyperparameter_ranges: dict,
n_combinations: int,
rng: Generator,
)[source]#

Initializes the pipeline element with a classifier.

Parameters#

learner: Classifier

The classifier associated with this pipeline element.

pass_forward(
instance: LabeledInstance,
) Instance[source]#

Trains the learner on the provided instance; then returns the instance.

Parameters#

instance: Instance

An instance to train the learner

Returns#

Instance

The instance that was provided to the function

pass_forward_predict(
instance: Instance,
prediction=None,
) Tuple[Instance, Any][source]#

Trains the learner on the provided instance; then returns the instance.

Parameters#

instance: Instance

An instance to train the learner

prediction: Any

Most likely None, but could be anything in principle

Returns#

Tuple[Instance, Any]

The transformed instance and the prediction of the regressor

train(instance: LabeledInstance)[source]#

The train function of the Classifier. Calls pass_forward internally.

Parameters#

instance: LabeledInstance

The instance to train on

predict(instance: Instance) int | None[source]#

The predict function of the classifier. Calls pass_forward_predict internally and returns the prediction.

Parameters#

instance: Instance

The instance to predict

Returns#

Optional[LabelIndex]

The prediction of the pipeline

predict_proba(
instance: Instance,
) ndarray[Any, dtype[float64]][source]#