Skip to main content

Python wrapper for DPMMSubClusters julia package

Project description

DPMMSubClusters

This package is a wrapper for DPMMSubClusters.jl Julia package.

Installation

pip install dpmmpython

If you already have Julia installed, install PyJulia and add the package DPMMSubClusters to your julia installation.

The next part only works with Ubuntu distributions at the moment!
If you do not have Julia installed, or wish to create a clean installation for the purpose of using this package. after installing (with pip), do the following:

import dpmmpython
dpmmpython.install()

Optional arguments are install(julia_download_path = 'https://julialang-s3.julialang.org/bin/linux/x64/1.4/julia-1.4.0-linux-x86_64.tar.gz', julia_target_path = None), where the former specify the julia download file, and the latter the installation path, if the installation path is not specified, $HOME$/julia will be used.

Usage Example:

from dpmmpython.dpmmwrapper import DPMMPython
from dpmmpython.priors import niw
import numpy as np

data,gt = DPMMPython.generate_gaussian_data(10000, 2, 10, 100.0)
prior = niw(1,np.zeros(2),4,np.eye(2)

data,gt = DPMMPython.generate_gaussian_data(10000, 2, 10, 100.0)
labels,_,sub_labels= DPMMPython.fit(data,100,prior = prior,verbose = True, gt = gt)
Iteration: 1 || Clusters count: 1 || Log posterior: -71190.14226686998 || Vi score: 1.990707323192506 || NMI score: 6.69243345834295e-16 || Iter Time:0.004499912261962891 || Total time:0.004499912261962891
Iteration: 2 || Clusters count: 1 || Log posterior: -71190.14226686998 || Vi score: 1.990707323192506 || NMI score: 6.69243345834295e-16 || Iter Time:0.0038819313049316406 || Total time:0.008381843566894531
...
Iteration: 98 || Clusters count: 9 || Log posterior: -40607.39498126549 || Vi score: 0.11887067921133423 || NMI score: 0.9692247699387838 || Iter Time:0.015907764434814453 || Total time:0.5749104022979736
Iteration: 99 || Clusters count: 9 || Log posterior: -40607.39498126549 || Vi score: 0.11887067921133423 || NMI score: 0.9692247699387838 || Iter Time:0.01072382926940918 || Total time:0.5856342315673828
Iteration: 100 || Clusters count: 9 || Log posterior: -40607.39498126549 || Vi score: 0.11887067921133423 || NMI score: 0.9692247699387838 || Iter Time:0.010260820388793945 || Total time:0.5958950519561768

Project details


Download files

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

Source Distribution

dpmmpython-0.1.1.dev0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

dpmmpython-0.1.1.dev0-py2-none-any.whl (6.4 kB view details)

Uploaded Python 2

File details

Details for the file dpmmpython-0.1.1.dev0.tar.gz.

File metadata

  • Download URL: dpmmpython-0.1.1.dev0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/44.1.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/2.7.15

File hashes

Hashes for dpmmpython-0.1.1.dev0.tar.gz
Algorithm Hash digest
SHA256 cff1da7650fd1d88c24684860804e42331a002b016f08a2854bda87ba3e1d2a1
MD5 1188af768d24a3f3d42220bf0d27458f
BLAKE2b-256 87ef8b6802e64c25bbe40839bd0291078333f18da32730f52312b3c20a263919

See more details on using hashes here.

File details

Details for the file dpmmpython-0.1.1.dev0-py2-none-any.whl.

File metadata

  • Download URL: dpmmpython-0.1.1.dev0-py2-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/44.1.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/2.7.15

File hashes

Hashes for dpmmpython-0.1.1.dev0-py2-none-any.whl
Algorithm Hash digest
SHA256 a9629257cd11dad283790da50c96ea1f28ebe3dfdabf93e54d5e18c8b50a1a56
MD5 13b939c9537be3afb00441b3a237e8b9
BLAKE2b-256 9d10172688fbcca9f00e7d911deb51f82e534e86600fef8ec7143fb5adca4277

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page