deepof.utils.kleinberg
- deepof.utils.kleinberg(offsets: list, s: float = 2.718281828459045, gamma: float = 1.0, n=None, T=None, k=None)
Apply Kleinberg’s algorithm (described in ‘Bursty and Hierarchical Structure in Streams’).
The algorithm models activity bursts in a time series as an infinite hidden Markov model.
Taken from pybursts (https://github.com/romain-fontugne/pybursts/blob/master/pybursts/pybursts.py) and adapted for dependency compatibility reasons.
- Parameters:
offsets (list) – a list of time offsets (numeric)
s (float) – the base of the exponential distribution that is used for modeling the event frequencies
gamma (float) – coefficient for the transition costs between states
n – to have a fixed cost function (not dependent of the given offsets). Which is needed if you want to compare bursts for different inputs.
T – to have a fixed cost function (not dependent of the given offsets). Which is needed if you want to compare bursts for different inputs.
k – maximum burst level