Python wrapper for DPMMSubClustersStreaming julia package
Project description
DPMMSubClustersStreaming
This package is a Python wrapper for the DPMMSubClustersStreaming.jl Julia package.
(for our paper Sampling in Dirichlet Process Mixture Models for Clustering Streaming Data, AISTATS 2022.).
Installation
- Install Julia from: https://julialang.org/downloads/platform
- Add our DPMMSubClusterStreaming package from within a Julia terminal via Julia package manager:
] add DPMMSubClustersStreaming
- Add our dpmmpythonStreaming package in python: pip install dpmmpythonStreaming
- Add Environment Variables:
On Linux:
- Add to the "PATH" environment variable the path to the Julia executable (e.g., in .bashrc add: export PATH =$PATH:$HOME/julia/julia-1.6.0/bin).
On Windows:
- Add to the "PATH" environment variable the path to the Julia executable (e.g., C:\Users<USER>\AppData\Local\Programs\Julia\Julia-1.6.0\bin).
- Install PyJulia from within a Python terminal:
import julia;julia.install();
Usage Example:
from julia.api import Julia
jl = Julia(compiled_modules=False)
from dpmmpythonStreaming.dpmmwrapper import DPMMPython
from dpmmpythonStreaming.priors import niw
import numpy as np
data,gt = DPMMPython.generate_gaussian_data(10000, 2, 10, 100.0)
batch1 = data[:,0:5000]
batch2 = data[:,5000:]
prior = DPMMPython.create_prior(2, 0, 1, 1, 1)
model= DPMMPython.fit_init(batch1,100.0,prior = prior,verbose = True, burnout = 5, gt = None, epsilon = 0.0000001)
labels = DPMMPython.get_labels(model)
model = DPMMPython.fit_partial(model,1, 2, batch2)
labels = DPMMPython.get_labels(model)
print(labels)
Misc
For any questions: dinari@post.bgu.ac.il
Contributions, feature requests, suggestion etc.. are welcomed.
If you use this code for your work, please cite the following:
@inproceedings{dinari2022streaming,
title={Sampling in Dirichlet Process Mixture Models for Clustering Streaming Data},
author={Dinari, Or and Freifeld, Oren},
booktitle={International Conference on Artificial Intelligence and Statistics},
year={2022}
}
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file dpmmpythonStreaming-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: dpmmpythonStreaming-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71d3e10936bc04bdcbec337156d8eef69c5169b446a010f625151e711fb8a2b3 |
|
MD5 | 09318550f7096bcc66a7f92abbab37ac |
|
BLAKE2b-256 | f304428134905dedeefd1f2282c3952ffede3dffe0171eea7466f2a5cad7dae3 |