Skip to content

Instantly share code, notes, and snippets.

@ianoc
ianoc / KMeansJob.scala
Last active September 29, 2015 17:56 — forked from azymnis/KMeansJob.scala
K-Means in scalding
import com.twitter.algebird.{Aggregator, Semigroup}
import com.twitter.scalding._
import scala.util.Random
/**
* This job is a tutorial of sorts for scalding's Execution[T] abstraction.
* It is a simple implementation of Lloyd's algorithm for k-means on 2D data.
*
* http://en.wikipedia.org/wiki/K-means_clustering