wiki:application_pages/apps/python/kmeans

Application Name

Kmeans

Summary

  • Name: Kmeans
  • Contact Person: support-compss@bsc.es
  • Access Level: public
  • License Agreement: Apache2
  • Platform: COMPSs
  • Repository: Kmeans

Description

K-means clustering is a method of cluster analysis that aims to partition n points into k clusters in which each point belongs to the cluster with the nearest mean. It follows an iterative refinement strategy to find the centers of natural clusters in the data.

When executed with COMPSs, K-means first generates the input points by means of initialization tasks. For parallelism purposes, the points are split in a number of fragments received as parameter, each fragment being created by an initialization task and filled with random points.

After the initialization, the algorithm goes through a set of iterations. In every iteration, a computation task is created for each fragment; then, there is a reduction phase where the results of each computation are accumulated two at a time by merge tasks; finally, at the end of the iteration the main program post-processes the merged result, generating the current clusters that will be used in the next iteration. Consequently, if F is the total number of fragments, K-means generates F computation tasks and F-1 merge tasks per iteration.

Execution instructions

Usage: runcompss kmeans.py <N> <initValue1> <initValue2> <initValue3>

where:

  • - N: Number of times to increase the counters
  • - initValue1: Initial value for counter 1

Execution Example

runcompss increment.py 10 1 2 3

Build

No build is required

Last modified 9 years ago Last modified on 10/26/15 09:33:48

Attachments (1)

Download all attachments as: .zip