GithubHelp home page GithubHelp logo

axmat / parallelkmeans Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 133.5 MB

Parallel K-Means Clustering Algorithm

License: MIT License

C++ 90.32% Julia 6.24% Makefile 2.96% Shell 0.49%
openmp kmeans-clustering

parallelkmeans's Introduction

Parallel K-Means clustering algorithm

K-Means algorithm

  1. Initialize the centers using kmeans++ algorithm
  2. Assign each point to the cluster with the nearest
  3. Update the clusters centers
  4. Repeats step 2 and 3 until convergence

Data set

The data set was generated from a gaussian mixture distribution.

Clusters obtained by runing the sequential Kmeans clustering algorithm.

dataset

Dependencies

  • C++ compiler with c++-17 support (tested on clang)
  • Make
  • [Optional] Julia (DataFrames, CSV and Plots packages)

Building

To build run make

Results

The following results are obtained for:

  • number of clusters : 3
  • number of threads: 32
  • number of repetitions: 30
  • maximum number of iterations: 1000
  • threshold : 0.1

To reproduce the results run ./benchmark 3 32 30 1000 0.1

Benchmark

benchmark

benchmark

Speedup

speedup

Conclusion

  • Used OPenMP for parallelization
  • Used speedup to evaluate the performances of the parallelized kmeans algorithm
  • Maximum speedup is ~7x

References

  1. T Kanungo, DM Mount, NS Netanyahu, C.D. Piatko, R. Silverman, A.Y. Wu. An efficient k-means clustering algorithm: Analysis and implementation, in IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 24, no. 7, pp. 881-892, July 2002.
  2. Arthur, David and Sergei Vassilvitski. k-means++: The Advantages of Careful Seeding, 2007.
  3. Barbara Chapman, Gabrielle Jost, Ruud Van Der Pas. Using OpenMP, 2007.
  4. Joe Pitt-Francis, Jonathan Whiteley. Guide to Scientific Computing in C++, Second Edition, 2017.
  5. OpenMP 4.5 Reference Guide โ€“ C/C++

parallelkmeans's People

Contributors

axmat avatar

Stargazers

 avatar  avatar

Watchers

 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.