Package org.apache.mahout.clustering.iterator

Examples of org.apache.mahout.clustering.iterator.ClusterIterator


    ModelDistribution<VectorWritable> modelDist = description.createModelDistribution(new Configuration());
    for (Model<VectorWritable> cluster : modelDist.sampleFromPrior(15)) {
      models.add((Cluster) cluster);
    }
   
    ClusterIterator iterator = new ClusterIterator();
    ClusterClassifier classifier = new ClusterClassifier(models, new DirichletClusteringPolicy(15, 1.0));
    ClusterClassifier posterior = iterator.iterate(sampleData, classifier, 10);
   
    printClusters(posterior.getModels(), DOCS);
  }
View Full Code Here


    ModelDistribution<VectorWritable> modelDist = description.createModelDistribution(new Configuration());
    for (Model<VectorWritable> cluster : modelDist.sampleFromPrior(15)) {
      models.add((Cluster) cluster);
    }
   
    ClusterIterator iterator = new ClusterIterator();
    ClusterClassifier classifier = new ClusterClassifier(models, new DirichletClusteringPolicy(15, 1.0));
    ClusterClassifier posterior = iterator.iterate(sampleData, classifier, 10);
   
    printClusters(posterior.getModels(), DOCS);
  }
View Full Code Here

    ModelDistribution<VectorWritable> modelDist = description.createModelDistribution(new Configuration());
    for (Model<VectorWritable> cluster : modelDist.sampleFromPrior(15)) {
      models.add((Cluster) cluster);
    }
   
    ClusterIterator iterator = new ClusterIterator();
    ClusterClassifier classifier = new ClusterClassifier(models, new DirichletClusteringPolicy(15, 1.0));
    ClusterClassifier posterior = iterator.iterate(sampleData, classifier, 10);
   
    printClusters(posterior.getModels(), DOCS2);
  }
View Full Code Here

    ModelDistribution<VectorWritable> modelDist = description.createModelDistribution(new Configuration());
    for (Model<VectorWritable> cluster : modelDist.sampleFromPrior(15)) {
      models.add((Cluster) cluster);
    }
   
    ClusterIterator iterator = new ClusterIterator();
    ClusterClassifier classifier = new ClusterClassifier(models, new DirichletClusteringPolicy(15, 1.0));
    ClusterClassifier posterior = iterator.iterate(sampleData, classifier, 10);
   
    printClusters(posterior.getModels(), DOCS2);
  }
View Full Code Here

   
    ClusterClassifier prior = new ClusterClassifier(models, new DirichletClusteringPolicy(numClusters, alpha0));
    prior.writeToSeqFiles(clustersIn);
   
    if (runSequential) {
      new ClusterIterator().iterateSeq(conf, input, clustersIn, output, maxIterations);
    } else {
      new ClusterIterator().iterateMR(conf, input, clustersIn, output, maxIterations);
    }
    return output;
   
  }
View Full Code Here

    ClusteringPolicy policy = new KMeansClusteringPolicy(convergenceDelta);
    ClusterClassifier prior = new ClusterClassifier(clusters, policy);
    prior.writeToSeqFiles(priorClustersPath);
   
    if (runSequential) {
      new ClusterIterator().iterateSeq(conf, input, priorClustersPath, output, maxIterations);
    } else {
      new ClusterIterator().iterateMR(conf, input, priorClustersPath, output, maxIterations);
    }
    return output;
  }
View Full Code Here

    ClusteringPolicy policy = new FuzzyKMeansClusteringPolicy(m, convergenceDelta);
    ClusterClassifier prior = new ClusterClassifier(clusters, policy);
    prior.writeToSeqFiles(priorClustersPath);
   
    if (runSequential) {
      new ClusterIterator().iterateSeq(conf, input, priorClustersPath, output, maxIterations);
    } else {
      new ClusterIterator().iterateMR(conf, input, priorClustersPath, output, maxIterations);
    }
    return output;
  }
View Full Code Here

    }
    ClusterClassifier prior = new ClusterClassifier(initialClusters, new FuzzyKMeansClusteringPolicy(m, threshold));
    Path priorPath = new Path(output, "classifier-0");
    prior.writeToSeqFiles(priorPath);
   
    new ClusterIterator().iterateSeq(conf, samples, priorPath, output, maxIterations);
    loadClustersWritable(output);
  }
View Full Code Here

    }
    ClusterClassifier prior = new ClusterClassifier(models, new DirichletClusteringPolicy(numClusters, alpha0));
    Path priorPath = new Path(output, Cluster.INITIAL_CLUSTERS_DIR);
    prior.writeToSeqFiles(priorPath);
    Configuration conf = new Configuration();
    new ClusterIterator().iterateSeq(conf, input, priorPath, output, numIterations);
  }
View Full Code Here

    ClusterClassifier prior = new ClusterClassifier(initialClusters, new KMeansClusteringPolicy(convergenceDelta));
    Path priorPath = new Path(output, Cluster.INITIAL_CLUSTERS_DIR);
    prior.writeToSeqFiles(priorPath);
   
    int maxIter = 10;
    new ClusterIterator().iterateSeq(conf, samples, priorPath, output, maxIter);
    loadClustersWritable(output);
  }
View Full Code Here

TOP

Related Classes of org.apache.mahout.clustering.iterator.ClusterIterator

Copyright © 2018 www.massapicom. 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.