All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.datastax.insight.ml.spark.mllib.cluster.SimpleKMeans Maven / Gradle / Ivy

The newest version!
package com.datastax.insight.ml.spark.mllib.cluster;

import com.datastax.insight.spec.RDDOperator;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.mllib.clustering.KMeans;
import org.apache.spark.mllib.clustering.KMeansModel;
import org.apache.spark.mllib.linalg.Vector;

public class SimpleKMeans implements RDDOperator {

    public static KMeansModel train(JavaRDD vectors, int numClusters, int numIterations){
        return KMeans.train(vectors.rdd(),numClusters,numIterations);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy