MOAClassifierSSL#

class capymoa.base.MOAClassifierSSL[source]#

Bases: MOAClassifier, ClassifierSSL

Wrapper for using MOA semi-supervised learning classifiers.

__init__(moa_learner, schema=None, CLI=None, random_seed=1)[source]#
cli_help()[source]#
classmethod from_params(
schema: Any = None,
params: dict[str, Any] | None = None,
random_seed: int = 1,
) → Any[source]#

Construct an instance from parameters produced by get_params.

get_params() → dict[str, Any][source]#

Return the hyper-parameters captured from the constructor.

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

Predict the label of an instance.

The base implementation calls predict_proba() and returns the label with the highest probability.

Parameters:

instance – The instance to predict the label for.

Returns:

The predicted label or None if the classifier is unable to make a prediction.

predict_proba(
instance,
) → ndarray[tuple[Any, ...], dtype[float64]] | None[source]#

Return probability estimates for each label.

Parameters:

instance – The instance to estimate the probabilities for.

Returns:

An array of probabilities for each label or None if the classifier is unable to make a prediction.

train(instance)[source]#

Train the classifier with a labeled instance.

Parameters:

instance – The labeled instance to train the classifier with.

train_on_unlabeled(instance: Instance)[source]#
random_seed: int#

The random seed for reproducibility.

When implementing a classifier ensure random number generators are seeded.

schema: Schema#

The schema representing the instances.