Majority Vote Alerting¶
The majority vote alerting method is a simple yet effective approach to detect drifts. It works by aggregating the results of multiple detectors or the same detector over sevearl instances and making a decision based on the majority of the votes. This method can help to reduce false positives and improve the overall accuracy of change point detection.
Majorty Vote Alerting Classes¶
- class source.alerting.majority_vote.MajorityVote(threshold: float = 0.5)¶
Bases:
objectMajority voting for change point detection (0 = no change point, 1 = change point).
- Parameters:
threshold (float) – Minimum proportion of positive votes required when use_threshold=True. Must be in [0.5, 1.0].
- __init__(threshold: float = 0.5)¶
- vote(detections: List[int], use_threshold: bool = False, mode: str = 'hard') int¶
Perform majority voting.
- Parameters:
detections (List[int]) – List of detections (0 or 1).
use_threshold (bool) – If True, requires fraction of 1s >= self.threshold.
mode (str) – “hard” for binary voting, “soft” for probabilistic voting (values in [0, 1]).
- Returns:
1 if change point is detected, else 0.
- Return type:
int