Giter VIP home page Giter VIP logo

same-size-k-means's Introduction

Equal Groups K-Means Clustering

Build Status

This is a k-means variation that produces clusters of the same size utilizing the scikit-learn Kmeans methods and associated utilities.

The same-size k-Means logic is the same as found in the Elki Same-size k-Means Variation tutorial.

https://elki-project.github.io/tutorial/same-size_k_means

Please note that this implementation only works in scikit-learn 17.X as later versions having breaking changes to this implementation. Also sparse matrices are not yet supported.

Usage

Use just like you would utilize the scikit-learn Kmeans class

from clustering.equal_groups import EqualGroupsKMeans

import numpy as np

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

clf = EqualGroupsKMeans(n_clusters=2)

clf.fit(X)

clf.labels_

Performance

The performance of this implementation is very slow. It is relatively quick if the number observations is less than 500.

Optimizations are readily accepted via pull-requests.

To Dos

  • More test coverage
  • Add support for sparse matrices
  • Package for pypi
  • Potentially speed up with cython
  • scikit-learn 18.X implementation

same-size-k-means's People

Contributors

ndanielsen avatar santolucito avatar dependabot[bot] avatar shitian-ni avatar sdushay avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.