Package org.apache.mahout.clustering.dirichlet.models

Examples of org.apache.mahout.clustering.dirichlet.models.SampledNormalDistribution


    generateSamples(40, 1, 1, 3);
    generateSamples(30, 1, 0, 0.1);
    generateSamples(30, 0, 1, 0.1);

    DirichletClusterer<VectorWritable> dc = new DirichletClusterer<VectorWritable>(
        sampleData, new SampledNormalDistribution(new VectorWritable(
            new DenseVector(2))), 1.0, 10, 1, 0);
    List<Model<VectorWritable>[]> result = dc.cluster(30);
    printResults(result, 2);
    assertNotNull(result);
  }
View Full Code Here


    generateSamples(400, 1, 1, 3);
    generateSamples(300, 1, 0, 0.1);
    generateSamples(300, 0, 1, 0.1);

    DirichletClusterer<VectorWritable> dc = new DirichletClusterer<VectorWritable>(
        sampleData, new SampledNormalDistribution(new VectorWritable(
            new DenseVector(2))), 1.0, 10, 1, 0);
    List<Model<VectorWritable>[]> result = dc.cluster(30);
    printResults(result, 20);
    assertNotNull(result);
  }
View Full Code Here

    generateSamples(4000, 1, 1, 3);
    generateSamples(3000, 1, 0, 0.1);
    generateSamples(3000, 0, 1, 0.1);

    DirichletClusterer<VectorWritable> dc = new DirichletClusterer<VectorWritable>(
        sampleData, new SampledNormalDistribution(new VectorWritable(
            new DenseVector(2))), 1.0, 10, 1, 0);
    List<Model<VectorWritable>[]> result = dc.cluster(30);
    printResults(result, 200);
    assertNotNull(result);
  }
View Full Code Here

    generateSamples(40, 1, 1, 3, 3);
    generateSamples(30, 1, 0, 0.1, 3);
    generateSamples(30, 0, 1, 0.1, 3);

    DirichletClusterer<VectorWritable> dc = new DirichletClusterer<VectorWritable>(
        sampleData, new SampledNormalDistribution(new VectorWritable(
            new DenseVector(3))), 1.0, 10, 1, 0);
    List<Model<VectorWritable>[]> result = dc.cluster(30);
    printResults(result, 2);
    assertNotNull(result);
  }
View Full Code Here

    generateResults();
    new DisplaySNDirichlet();
  }
 
  static void generateResults() {
    DisplayDirichlet.generateResults(new SampledNormalDistribution(new VectorWritable(new DenseVector(2))));
  }
View Full Code Here

  public void testReducer() throws Exception {
    generateSamples(100, 0, 0, 1);
    generateSamples(100, 2, 0, 1);
    generateSamples(100, 0, 2, 1);
    generateSamples(100, 2, 2, 1);
    DirichletState<VectorWritable> state = new DirichletState<VectorWritable>(new SampledNormalDistribution(
        new VectorWritable(new DenseVector(2))), 20, 1);
    DirichletMapper mapper = new DirichletMapper();
    mapper.configure(state);
   
    DummyOutputCollector<Text,VectorWritable> mapCollector = new DummyOutputCollector<Text,VectorWritable>();
View Full Code Here

  public void testMRIterations() throws Exception {
    generateSamples(100, 0, 0, 1);
    generateSamples(100, 2, 0, 1);
    generateSamples(100, 0, 2, 1);
    generateSamples(100, 2, 2, 1);
    DirichletState<VectorWritable> state = new DirichletState<VectorWritable>(new SampledNormalDistribution(
        new VectorWritable(new DenseVector(2))), 20, 1.0);
   
    List<Model<VectorWritable>[]> models = new ArrayList<Model<VectorWritable>[]>();
   
    for (int iteration = 0; iteration < 10; iteration++) {
View Full Code Here

  @Test
  public void testDirichlet() throws Exception {
    Path output = getTestTempDirPath("output");
    NamedVector prototype = (NamedVector) sampleData.get(0).get();
    AbstractVectorModelDistribution modelDistribution = new SampledNormalDistribution(new VectorWritable(prototype));
    Configuration conf = new Configuration();
    DirichletDriver.run(conf, getTestTempDirPath("testdata"), output, modelDistribution, 15, 10, 1.0, true, true, 0, false);
    // run ClusterDumper
    ClusterDumper clusterDumper = new ClusterDumper(finalClusterPath(conf, output, 10), new Path(output, "clusteredPoints"));
    clusterDumper.printClusters(termDictionary);
View Full Code Here

    generateSamples(40, 1, 1, 3);
    generateSamples(30, 1, 0, 0.1);
    generateSamples(30, 0, 1, 0.1);

    DirichletClusterer dc = new DirichletClusterer(sampleData,
                                                   new SampledNormalDistribution(new VectorWritable(new DenseVector(2))),
                                                   1.0,
                                                   10,
                                                   1,
                                                   0);
    List<Cluster[]> result = dc.cluster(30);
View Full Code Here

    generateSamples(40, 1, 1, 3, 3);
    generateSamples(30, 1, 0, 0.1, 3);
    generateSamples(30, 0, 1, 0.1, 3);

    DirichletClusterer dc = new DirichletClusterer(sampleData,
                                                   new SampledNormalDistribution(new VectorWritable(new DenseVector(3))),
                                                   1.0,
                                                   10,
                                                   1,
                                                   0);
    List<Cluster[]> result = dc.cluster(30);
View Full Code Here

TOP

Related Classes of org.apache.mahout.clustering.dirichlet.models.SampledNormalDistribution

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.