Giter Site home page Giter Site logo

benjamindoran / unidip Goto Github PK

View Code? Open in Web Editor NEW
36.0 4.0 10.0 146 KB

Python port of the Unidip clustering algorithm from: http://www.kdd.org/kdd2016/subtopic/view/skinny-dip-clustering-in-a-sea-of-noise

License: GNU General Public License v3.0

Python 100.00%
unidip skinnydip noise-robust algorithm clustering

unidip's People

Contributors

benjamindoran avatar drguy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

unidip's Issues

RuntimeWarning: divide by zero encountered in true_divide & invalid value encountered in multiply

Hi @BenjaminDoran ,
I find unidip very helpful in identifying unimodal distributions. Thanks for the development of this package!

Regarding the warning I get, this happens when I run dip.diptst

/python3.6/site-packages/unidip/dip.py:27: RuntimeWarning: divide by zero encountered in true_divide
  slopes = (work_cdf[1:] - work_cdf[0]) / distances
/python3.6/site-packages/unidip/dip.py:30: RuntimeWarning: invalid value encountered in multiply
  gcm.extend(work_cdf[0] + distances[:minslope_idx] * minslope)

After the warning, the process stalls for a very long time.
Looking at the values, I couldn't pinpoint the reason why this is happening. Any suggestions?
I wonder how I could avoid this warning.

UniDip returns empty array

Running it with this list returns an empty array, is this expected?
Shouldn't it return at least one result?

[-1.7321488631490713, -1.7321488631490713, -1.4811330900800335, -1.4811330900800335, -1.3022212430204045, -1.2717876122825453, -1.211729705204752, -1.211729705204752, -1.211729705204752, -1.0643373712891142, -1.0643373712891142, -1.0068300836569808, -1.0068300836569808, -1.0068300836569808, -1.0068300836569808, -0.93488438396035, -0.9240098946317632, -0.9210480479452614, -0.9210480479452614, -0.9169604252707326, -0.910481737919528, -0.910481737919528, -0.910481737919528, -0.8884333993387736, -0.8884333993387736, -0.8774734971225411, -0.8662954695554639, -0.8528953736209124, -0.8347337812492381, -0.8347337812492381, -0.8254311371686884, -0.8254311371686884, -0.8254311371686884, -0.8254311371686884, -0.8254311371686884, -0.8254311371686884, -0.8254311371686884, -0.8254311371686884, -0.8186966057281344, -0.7822676720935519, -0.7732098730652197, -0.7732098730652197, -0.7732098730652197, -0.7732098730652197, -0.7732098730652197, -0.7732098730652197, -0.7732098730652197, -0.7604371692027225, -0.7604371692027225, -0.7184651234303354, -0.7184651234303354, -0.7184651234303354, -0.7184651234303354, -0.7184651234303354, -0.7184651234303354, -0.7184651234303354, -0.7184651234303354, -0.7184651234303354, -0.7184651234303354, -0.6562230498767323, -0.6562230498767323, -0.6562230498767323, -0.6562230498767323, -0.6562230498767323, -0.6562230498767323, -0.6562230498767323, -0.6562230498767323, -0.6429924962522777, -0.6429924962522777, -0.6429924962522777, -0.6429924962522777, -0.6429924962522777, -0.6429924962522777, -0.6069943256197385, -0.6069943256197385, -0.6069943256197385, -0.6069943256197385, -0.6069943256197385, -0.6069943256197385, -0.5954041171436801, -0.5431426862261441, -0.5431426862261441, -0.5142420706343538, -0.5142420706343538, -0.5142420706343538, -0.5142420706343538, -0.5142420706343538, -0.5142420706343538, -0.5142420706343538, -0.5142420706343538, -0.4758761151656534, -0.4758761151656534, -0.4597064652077143, -0.4597064652077143, -0.4597064652077143, -0.4480050230671342, -0.4480050230671342, -0.2140861382454502, -0.2140861382454502, -0.2140861382454502, -0.2140861382454502, -0.1588138036471789, -0.1588138036471789, -0.036075132086434536, 0.14230167504323354, 0.5357475959080094, 0.5357475959080094, 0.5716170975364421, 0.5763855126721228, 0.5765579831608809, 0.5765579831608809, 0.5765579831608809, 0.588359377758227, 0.588359377758227, 0.588359377758227, 0.5958301926543572, 0.5958301926543572, 0.5958301926543572, 0.5958301926543572, 0.5958301926543572, 0.5958301926543572, 0.6212950129383263, 0.6212950129383263, 0.6212950129383263, 0.6212950129383263, 0.6212950129383263, 0.6325814867346722, 0.6325814867346722, 0.6325814867346722, 0.6325814867346722, 0.6325814867346722, 0.6389869403409391, 0.6389869403409391, 0.6584198203060039, 0.6584198203060039, 0.6584198203060039, 0.6584198203060039, 0.6584198203060039, 0.6584198203060039, 0.6958291014778762, 0.6958291014778762, 0.6990612564591703, 0.7119598760986781, 0.7119598760986781, 0.7211152863447583, 0.7211152863447583, 0.7211152863447583, 0.7211152863447583, 0.7211152863447583, 0.7211152863447583, 0.7211152863447583, 0.7211152863447583, 0.7211152863447583, 0.7211152863447583, 0.7211152863447583, 0.7211152863447583, 0.7211152863447583, 0.725389613191505, 0.725389613191505, 0.725389613191505, 0.725389613191505, 0.725389613191505, 0.725389613191505, 0.814682710085783, 0.814682710085783, 0.814682710085783, 0.8275420646774649, 0.8275420646774649, 0.8275420646774649, 0.8275420646774649, 0.9046055225669343, 0.9046055225669343, 0.9046055225669343, 0.9054035860830063, 0.9054035860830063, 0.9054035860830063, 0.9459602397628304, 0.9459602397628304, 0.9496206931864464, 0.9496206931864464, 0.9496206931864464, 0.9496206931864464, 0.9504804742173372, 0.9504804742173372, 0.9978027326125107, 0.9978027326125107, 0.9978027326125107, 1.0315973696216347, 1.0315973696216347, 1.0315973696216347, 1.0315973696216347, 1.0315973696216347, 1.0646299267140256, 1.1272302726476822, 1.1272302726476822, 1.2532571146831004, 1.2532571146831004, 1.3733262005067424, 1.62906282973043, 1.62906282973043]

no module named 'unidip'

Per your website instructions, I used 'from unidip import UniDip' and I got an error on the import statement saying there is no module named unidip. I used pip to install it like your page says, and using pip list it shows up there. Cannot figure out why it's not recognizing it.

I haven't even tried to use it yet, just importing to make sure it works.

I'm using anaconda.

Return same values when running recursively

I'm looping through alpha values to test the amount of peaks each finds, and I get the same output every time. I get different values if I run each alpha individually.

for i in [0.06,0.055,0.05,0.04]:#np.arange(0.07,0.05,-0.002):
data = np.msort(np.array(analysisuncomp).flatten())
print(i)
print(UniDip(data,alpha=i,ntrials=500).run())

Output:
0.06
[(6, 127), (135, 181), (196, 313), (370, 5683), (5685, 10540), (10545, 30064)]
0.055
[(6, 127), (135, 181), (196, 313), (370, 5683), (5685, 10540), (10545, 30064)]
0.05
[(6, 127), (135, 181), (196, 313), (370, 5683), (5685, 10540), (10545, 30064)]
0.04

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.