Examples of cluster()


Examples of org.apache.mahout.clustering.dirichlet.DirichletClusterer.cluster()

                                        int numIterations,
                                        double alpha0,
                                        int thin,
                                        int burnin) {
    DirichletClusterer dc = new DirichletClusterer(SAMPLE_DATA, modelDist, alpha0, numClusters, thin, burnin);
    List<Cluster[]> result = dc.cluster(numIterations);
    printModels(result, burnin);
    for (Cluster[] models : result) {
      List<Cluster> clusters = new ArrayList<Cluster>();
      for (Cluster cluster : models) {
        if (isSignificant(cluster)) {
View Full Code Here

Examples of org.apache.mahout.clustering.dirichlet.DirichletClusterer.cluster()

                                                      int numIterations,
                                                      double alpha0,
                                                      int thin,
                                                      int burnin) {
    DirichletClusterer dc = new DirichletClusterer(SAMPLE_DATA, modelDist, alpha0, numClusters, thin, burnin);
    List<Cluster[]> result = dc.cluster(numIterations);
    printModels(result, burnin);
    for (Cluster[] models : result) {
      List<Cluster> clusters = Lists.newArrayList();
      for (Cluster cluster : models) {
        if (isSignificant(cluster)) {
View Full Code Here

Examples of org.apache.mahout.clustering.dirichlet.DirichletClusterer.cluster()

                                                      int numIterations,
                                                      double alpha0,
                                                      int thin,
                                                      int burnin) {
    DirichletClusterer dc = new DirichletClusterer(SAMPLE_DATA, modelDist, alpha0, numClusters, thin, burnin);
    List<Cluster[]> result = dc.cluster(numIterations);
    printModels(result, burnin);
    for (Cluster[] models : result) {
      List<Cluster> clusters = new ArrayList<Cluster>();
      for (Cluster cluster : models) {
        if (isSignificant(cluster)) {
View Full Code Here

Examples of org.apache.mahout.clustering.streaming.cluster.BallKMeans.cluster()

    float testProbability = conf.getFloat(StreamingKMeansDriver.TEST_PROBABILITY, 0.1f);
    int numRuns = conf.getInt(StreamingKMeansDriver.NUM_BALLKMEANS_RUNS, 3);

    BallKMeans clusterer = new BallKMeans(StreamingKMeansUtilsMR.searcherFromConfiguration(conf),
        numClusters, maxNumIterations, trimFraction, kMeansPlusPlusInit, correctWeights, testProbability, numRuns);
    return clusterer.cluster(centroids);
  }
}
View Full Code Here

Examples of org.apache.mahout.clustering.streaming.cluster.BallKMeans.cluster()

    float testProbability = conf.getFloat(StreamingKMeansDriver.TEST_PROBABILITY, 0.1f);
    int numRuns = conf.getInt(StreamingKMeansDriver.NUM_BALLKMEANS_RUNS, 3);

    BallKMeans ballKMeansCluster = new BallKMeans(StreamingKMeansUtilsMR.searcherFromConfiguration(conf),
        numClusters, maxNumIterations, trimFraction, kMeansPlusPlusInit, correctWeights, testProbability, numRuns);
    return ballKMeansCluster.cluster(centroids);
  }
}
View Full Code Here

Examples of org.apache.mahout.clustering.streaming.cluster.StreamingKMeans.cluster()

      estimateDistanceCutoff = ClusteringUtils.estimateDistanceCutoff(estimatePoints, searcher.getDistanceMeasure());
    }

    StreamingKMeans clusterer = new StreamingKMeans(searcher, numClusters, estimateDistanceCutoff);
    while (datapointsIterator.hasNext()) {
      clusterer.cluster(datapointsIterator.next());
    }
    clusterer.reindexCentroids();

    return clusterer;
  }
View Full Code Here

Examples of org.apache.mahout.clustering.streaming.cluster.StreamingKMeans.cluster()

    // Clusters the data using local batch StreamingKMeans.
    StreamingKMeans batchClusterer =
        new StreamingKMeans(StreamingKMeansUtilsMR.searcherFromConfiguration(configuration),
            mapDriver.getConfiguration().getInt("estimatedNumMapClusters", -1), DISTANCE_CUTOFF);
    batchClusterer.cluster(syntheticData.getFirst());
    List<Centroid> batchCentroids = Lists.newArrayList();
    for (Vector v : batchClusterer) {
      batchCentroids.add((Centroid) v);
    }
View Full Code Here

Examples of org.apache.mahout.clustering.streaming.cluster.StreamingKMeans.cluster()

    // Clusters the data using point by point StreamingKMeans.
    StreamingKMeans perPointClusterer =
        new StreamingKMeans(StreamingKMeansUtilsMR.searcherFromConfiguration(configuration),
            (1 << NUM_DIMENSIONS) * (int)Math.log(NUM_DATA_POINTS), DISTANCE_CUTOFF);
    for (Centroid datapoint : syntheticData.getFirst()) {
      perPointClusterer.cluster(datapoint);
    }
    List<Centroid> perPointCentroids = Lists.newArrayList();
    for (Vector v : perPointClusterer) {
      perPointCentroids.add((Centroid) v);
    }
View Full Code Here

Examples of org.apache.mahout.clustering.streaming.cluster.StreamingKMeans.cluster()

    StreamingKMeans clusterer =
        new StreamingKMeans(StreamingKMeansUtilsMR .searcherFromConfiguration(configuration),
            (1 << NUM_DIMENSIONS) * (int)Math.log(NUM_DATA_POINTS), DISTANCE_CUTOFF);

    long start = System.currentTimeMillis();
    clusterer.cluster(syntheticData.getFirst());
    long end = System.currentTimeMillis();

    System.out.printf("%f [s]\n", (end - start) / 1000.0);
    List<CentroidWritable> reducerInputs = Lists.newArrayList();
    int postMapperTotalWeight = 0;
View Full Code Here

Examples of org.apache.mahout.clustering.streaming.cluster.StreamingKMeans.cluster()

    if (!dataPointsIterator.hasNext()) {
      dataPointsIterator = dataPoints.iterator();
    }

    while (dataPointsIterator.hasNext()) {
      streamingKMeans.cluster(dataPointsIterator.next());
    }

    streamingKMeans.reindexCentroids();
    return streamingKMeans;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.