Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Python port of the UniDip clustering algorithm

Project description

UniDip Python Port

See reference paper:

UniDip is a noise robust clustering algorithm for 1 dimensional numeric data. It recursively extracts peaks of density in the data utilizing the Hartigan Dip-test of Unimodality.


coming soon...

pip3.6 install unidip


Basic Usage

from unidip import UniDip

# create bi-modal distribution
dat = np.concatenate([np.random.randn(200)-3, np.random.randn(200)+3])

# sort data so returned indices are meaningful
dat = np.msort(dat)

# get start and stop indices of peaks 
intervals = UniDip(dat).run()

Advanced Options

  • alpha: control sensitivity as p-value. Default is 0.05. increase to isolate more peaks with less confidence. Or, decrease to isolate only peaks that are least likely to be noise.
  • mrg_dst: Defines how close intervals must be before they are merged.
  • ntrials: how many trials are run in Hartigan Dip Test more trials adds confidance but takes longer.
intervals = UniDip(dat, alpha=0.001, ntrials=1000, mrg_dst=5).run()

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 unidip, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size unidip-0.1.1-py3-none-any.whl (6.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size unidip-0.1.1.tar.gz (6.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page