Skip to main content

Assumption Free and Efficient K-Means Seeding

Project description

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
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/.

License

The project is licensed under the MIT License.

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

afkmc2-0.1.tar.gz (4.1 kB view details)

Uploaded Source

File details

Details for the file afkmc2-0.1.tar.gz.

File metadata

  • Download URL: afkmc2-0.1.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for afkmc2-0.1.tar.gz
Algorithm Hash digest
SHA256 4a6a48948c64f2bc580cd780087162ff3ae675ae3f3beb98b001b94628ff9b8a
MD5 1dd3439a768ecb54923d7a623bf8bb5d
BLAKE2b-256 4f9f4abca0daf62c08bac4cd751d6bf4dd6e1ee8f2962df9f7f89b0cfb21d86d

See more details on using hashes here.

Supported by

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