public class KMeansDataGenerator
extends Object
Constructor and Description |
---|
KMeansDataGenerator() |
Modifier and Type | Method and Description |
---|---|
static RDD<double[]> |
generateKMeansRDD(SparkContext sc,
int numPoints,
int k,
int d,
double r,
int numPartitions)
Generate an RDD containing test data for KMeans.
|
static void |
main(String[] args) |
public static RDD<double[]> generateKMeansRDD(SparkContext sc, int numPoints, int k, int d, double r, int numPartitions)
sc
- SparkContext to use for creating the RDDnumPoints
- Number of points that will be contained in the RDDk
- Number of clustersd
- Number of dimensionsr
- Scaling factor for the distribution of the initial centersnumPartitions
- Number of partitions of the generated RDD; default 2public static void main(String[] args)