ClassificationWindowedEvaluator#

class capymoa.evaluation.ClassificationWindowedEvaluator[source]#

Bases: ClassificationEvaluator

Uses the ClassificationEvaluator to perform a windowed evaluation.

IMPORTANT: The results for the last window are not always available through `metrics()`, if the window_size does not perfectly divide the stream, the metrics corresponding to the last remaining instances in the last window can be obtained by invoking `metrics()`

__init__(schema=None, window_size=1000)[source]#
accuracy()[source]#
kappa()[source]#
kappa_t()[source]#
kappa_m()[source]#
f1_score()[source]#
precision()[source]#
recall()[source]#
get_instances_seen()[source]#
metrics()[source]#
metrics_dict()[source]#
metrics_header()[source]#
metrics_per_window()[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.