Skip to content
forked from adriangoe/afkmc2

Python Implementation of Assumption Free K-Means Seeding using Markov Chain Monte Carlo

License

Notifications You must be signed in to change notification settings

mutual-ai/afkmc2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Documentation Status

Assumption Free KMeans Monte Carlo

This package contains sklearn compatible python implementations of various K-Means seeding algorithms.

The package was inspired by the AFKMC^2 algorithm detailed in

Fast and Provably Good Seedings for k-Means [afkmc2]_
Olivier Bachem, Mario Lucic, S. Hamed Hassani and Andreas Krause
In Neural Information Processing Systems (NIPS), 2016.

The algorithm uses Monte Carlo Markov Chain to quickly find good seedings for KMeans and offers a runtime improvement over the common K-Means++ algorithm.

Usage

Using this package to get seedings for KMeans in sklearn is as simple as:

import afkmc2
X = np.array([[1, 2], [1, 4], [1, 0],
             [4, 2], [4, 4], [4, 0]])
seeds = afkmc2.afkmc2(X, 2)

from sklearn.custer import KMeans
model = KMeans(n_clusters=2, init=seeds).fit(X)
print model.cluster_centers_

Installation

Quickly install afkmc2 by running (coming soon):

pip install afkmc2

Contribute

Support

You can reach out to me through https://adriangoe.me/#contact-us.

License

The project is licensed under the MIT License.

About

Python Implementation of Assumption Free K-Means Seeding using Markov Chain Monte Carlo

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%