ClassificationEvaluator#

class capymoa.evaluation.ClassificationEvaluator[source]#

Bases: object

Wrapper for the Classification Performance Evaluator from MOA. By default, it uses the BasicClassificationPerformanceEvaluator

__init__(
schema: Schema = None,
window_size=None,
allow_abstaining=True,
moa_evaluator=None,
)[source]#
get_instances_seen()[source]#
update(y_target_index: int, y_pred_index: int | None)[source]#

Update the evaluator with the ground-truth and the prediction.

Parameters:
  • y_target_index – The ground-truth class index. This is NOT the actual class value, but the index of the class value in the schema.

  • y_pred_index – The predicted class index. If the classifier abstains from making a prediction, this value can be None.

Raises:

ValueError – If the values are not valid indexes in the schema.

metrics_header()[source]#
metrics()[source]#
metrics_dict()[source]#
metrics_per_window()[source]#
accuracy()[source]#
kappa()[source]#
kappa_t()[source]#
kappa_m()[source]#
f1_score()[source]#
precision()[source]#
recall()[source]#