WeightedkNN#
- class capymoa.classifier.WeightedkNN[source]#
Bases:
MOAClassifier
WeightedKNN Reference:
‘Effective Weighted k-Nearest Neighbors for Dynamic Data Streams’ Maroua Bahri IEEE International Conference on Big Data (Big Data), 2022 <https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=10020652> Example usages: >>> from capymoa.datasets import ElectricityTiny >>> from capymoa.classifier import WeightedkNN >>> from capymoa.evaluation import prequential_evaluation >>> stream = ElectricityTiny() >>> schema = stream.get_schema() >>> learner = WeightedkNN(schema) >>> results = prequential_evaluation(stream, learner, max_instances=1000) >>> results[“cumulative”].accuracy() 74.7