Skip to content

Python implementation of Bregman Hard Clustering and Bregman Soft Clustering as a scikit-learn module.

License

Notifications You must be signed in to change notification settings

juselara1/bregclus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clustering with Bregman Divergences

Python implementation of Clustering with Bregman Divergences as a scikit-learn module:

  • Banerjee, A., Merugu, S., Dhillon, I. S., & Ghosh, J. (2005). Clustering with Bregman divergences. Journal of machine learning research, 6(Oct), 1705-1749. pdf

Requirements


If you have anaconda installed, you can create an environment with the dependences as follows:

conda env create -f requirements.yml

Then, you must activate the environment:

source activate env

or

conda activate env

Installation


You can install this package via setuptools:

python setup.py install

Usage


You can use the models as you usually do in sklearn:

from bregclus.models import BregmanHard
from bregclus.divergences import euclidean
import numpy as np

X = np.random.uniform(size=(100, 2))

model = BregmanHard(n_clusters=5, divergence=euclidean)
model.fit(X)
y_pred = model.predict(X)

Feel free to check the example codes: examples/

python euclidean_hard.py
python mahalanobis_hard.py

About

Python implementation of Bregman Hard Clustering and Bregman Soft Clustering as a scikit-learn module.

Topics

Resources

License

Stars

Watchers

Forks

Languages