MOAClassifier#

class capymoa.base.MOAClassifier[source]#

Bases: Classifier

A wrapper class for using MOA (Massive Online Analysis) classifiers in CapyMOA.

Attributes: - schema: The schema representing the instances. Defaults to None. - CLI: The command-line interface (CLI) configuration for the MOA learner. - random_seed: The random seed for reproducibility. Defaults to 1. - moa_learner: The MOA learner object or class identifier.

__init__(moa_learner, schema=None, CLI=None, random_seed=1)[source]#
CLI_help()[source]#
train(instance)[source]#

Train the classifier with a labeled instance.

Parameters:

instance – The labeled instance to train the classifier with.

predict(instance)[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)[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.

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.