A Python port of the 'burst detection' algorithm by Kleinberg, originally implemented in R
Project description
Changelog
0.1.1
Update readme view commit
Tidy up module imports view commit
Add .gitignore view commit
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.
Installation
pip install pybursts
or
easy_install pybursts
Dependencies
Usage
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)
Input
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
Output
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).
References
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file pybursts-0.1.1.tar.gz
.
File metadata
- Download URL: pybursts-0.1.1.tar.gz
- Upload date:
- Size: 1.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b6f48013802d7905cca6ca19f1b2162fee4734885bb72eeb79cb7d4dc60e50d |
|
MD5 | 5f40d98f7fa8460e7bd00a564861af99 |
|
BLAKE2b-256 | 1071804e7bb39b104a100b318ca18275385c3d65e54d69ced258aed21914aeaf |