Peaks-Over-Threshold (POT)#
- class oats.threshold.pot.POTThreshold(**kwargs)[source]#
Bases:
Threshold
Fit the tails of the data with Generalized Pareto Distribution (GPD). Find the threshold where P(thres) < q. Usual values for q is 1e-3 to 1e-6.
Siffer, Alban and Fouque, Pierre-Alain and Termier, Alexandre and Largouet, Christine “Anomaly Detection in Streams with Extreme Value Theory” https://doi.org/10.1145/3097983.3098144
- get_threshold(data, q: float = 0.0001, tail_level: float = 0.95)[source]#
- Parameters:
data (np.ndarray) – array of data/anomaly scores
q (float, optional) – q level such that P(threshold) < q. Defaults to 1e-4.
tail_level (float, optional) – threshold to fit tail distribution. Defaults to 0.95.
- Returns:
array of thresholds
- Return type:
np.ndarray