HDDMWeighted#
- class capymoa.drift.detectors.HDDMWeighted[source]#
Bases:
MOADriftDetector
Weighted Hoeffding’s bounds Drift Detector
Example usages:#
>>> import numpy as np >>> from capymoa.drift.detectors import HDDMWeighted >>> np.random.seed(0) >>> >>> detector = HDDMWeighted(lambda_=0.001) >>> >>> data_stream = np.random.randint(2, size=2000) >>> for i in range(999, 2000): ... data_stream[i] = np.random.randint(4, high=8) >>> >>> for i in range(2000): ... detector.add_element(data_stream[i]) ... if detector.detected_change(): ... print('Change detected in data: ' + str(data_stream[i]) + ' - at index: ' + str(i)) Change detected in data: 6 - at index: 1234
Reference:#
Frias-Blanco, Isvani, et al. “Online and non-parametric drift detection methods based on Hoeffding’s bounds.” IEEE Transactions on Knowledge and Data Engineering 27.3 (2014): 810-823.
- TEST_TYPES = ['Two-sided', 'One-sided']#
- __init__(
- drift_confidence: float = 0.001,
- warning_confidence: float = 0.005,
- lambda_: float = 0.05,
- test_type: str = 'Two-sided',
- CLI: str | None = None,
- Parameters:
moa_detector – The MOA detector object or class identifier.
CLI – The command-line interface (CLI) configuration for the MOA drift detector, defaults to None