Giter VIP home page Giter VIP logo

kmeans-spark's Introduction

kmeans-spark - a simple implementation of k-means clustering on the Spark cluster computing framework

COMPILING
=========

Edit the Makefile and run to set SPARK_HOME and FWDIR appropriately. Then run
     make

This builds Spark along with kmeans-spark in a pretty hacky fashion. At some point it would be good to move to sbt.

RUNNING ON SPARK
================

Use the following command:
    ./run SparkKMeans <pointsFile> <numClusters> <host> [<startCentroid1X>,<startCentroid1Y>, ...]

pointsFile - the location of the input dataset. Any path that SparkContext.textFile understands is fine, including hdfs paths. This file should be formatted with one 2D point per line using the following format string: "%f\t%f\n".format(point.x, point.y). Lines beginning with # will be ignored.

numClusters - an integer representing the number of clusters to use (the value of k).

host - the Mesos host to run on, or "local" to run locally.
startCentroid1{X,Y} - optionally, the initial centroid values.

GENERATING POINTS
=================

To generate random points distributed randomly in clusters, use the following command:
    ./run KMeansDataGenerator <numClusters> <numPoints> <pointSpread>
This will generate the points data and send it to standard output. It will also print the generated centroids at the beginning of the file, preceded by # so they are ignored by SparkKMeans.

numClusters - the number of clusters to generate.

numPoints - the number of random points to generate. Each point is generated close to the centroid of a random cluster, randomly perturbed according to a Gaussian distribution.

pointSpread - the Gaussian spread of points around centroids.

kmeans-spark's People

Contributors

ankurdave avatar

Watchers

James Cloos avatar vanguard_space avatar  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.