Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

A Python port of the 'burst detection' algorithm by Kleinberg, originally implemented in R

Project description




This is a Python port of the R implementation of 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.


pip install pybursts


easy_install pybursts



import pybursts

offsets = [4, 17, 23, 27, 33, 35, 37, 76, 77, 82, 84, 88, 90, 92]
print pybursts.kleinberg(offsets, s=2, gamma=0.1)


  • offsets: a list of time offsets (numeric)
  • s: the base of the exponential distribution that is used for modeling the event frequencies
  • gamma: coefficient for the transition costs between states


An array of intervals in which a burst of activity was detected. The first column denotes the level within the hierarchy; the second column the start value of the interval; the third column the end value. The first row is always the top-level activity (the complete interval from start to finish).

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pybursts, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size pybursts-0.1.1.tar.gz (1.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page