MajorityClass#
- class capymoa.classifier.MajorityClass[source]#
Bases:
MOAClassifier
Majority class classifier.
Always predicts the class that has been observed most frequently the in the training data.
Example usages:
>>> from capymoa.datasets import ElectricityTiny >>> from capymoa.classifier import MajorityClass >>> from capymoa.evaluation import prequential_evaluation >>> stream = ElectricityTiny() >>> schema = stream.get_schema() >>> learner = MajorityClass(schema) >>> results = prequential_evaluation(stream, learner, max_instances=1000) >>> results["cumulative"].accuracy() 50.2