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

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


  }

  @Test
  public void testGaussianClusterClassification() {
    List<Model<VectorWritable>> models = new ArrayList<Model<VectorWritable>>();
    models.add(new GaussianCluster(new DenseVector(2).assign(1), new DenseVector(2).assign(1), 0));
    models.add(new GaussianCluster(new DenseVector(2), new DenseVector(2).assign(1), 1));
    models.add(new GaussianCluster(new DenseVector(2).assign(-1), new DenseVector(2).assign(1), 2));
    AbstractVectorClassifier classifier = new VectorModelClassifier(models);
    Vector pdf = classifier.classify(new DenseVector(2));
    assertEquals("[0,0]", "[0.274, 0.452, 0.274]", AbstractCluster.formatVector(pdf, null));
    pdf = classifier.classify(new DenseVector(2).assign(2));
    assertEquals("[2,2]", "[0.806, 0.180, 0.015]", AbstractCluster.formatVector(pdf, null));
View Full Code Here


    return new ClusterClassifier(models);
  }
 
  private static ClusterClassifier newGaussianClassifier() {
    List<Cluster> models = Lists.newArrayList();
    models.add(new GaussianCluster(new DenseVector(2).assign(1),
        new DenseVector(2).assign(1), 0));
    models.add(new GaussianCluster(new DenseVector(2), new DenseVector(2)
        .assign(1), 1));
    models.add(new GaussianCluster(new DenseVector(2).assign(-1),
        new DenseVector(2).assign(1), 2));
    return new ClusterClassifier(models);
  }
View Full Code Here

    return new ClusterClassifier(models, new FuzzyKMeansClusteringPolicy());
  }
 
  private static ClusterClassifier newGaussianClassifier() {
    List<Cluster> models = Lists.newArrayList();
    models.add(new GaussianCluster(new DenseVector(2).assign(1), new DenseVector(2).assign(1), 0));
    models.add(new GaussianCluster(new DenseVector(2), new DenseVector(2).assign(1), 1));
    models.add(new GaussianCluster(new DenseVector(2).assign(-1), new DenseVector(2).assign(1), 2));
    return new ClusterClassifier(models, new DirichletClusteringPolicy(3, 1.0));
  }
View Full Code Here

    return new ClusterClassifier(models);
  }
 
  private static ClusterClassifier newGaussianClassifier() {
    List<Cluster> models = new ArrayList<Cluster>();
    models.add(new GaussianCluster(new DenseVector(2).assign(1),
        new DenseVector(2).assign(1), 0));
    models.add(new GaussianCluster(new DenseVector(2), new DenseVector(2)
        .assign(1), 1));
    models.add(new GaussianCluster(new DenseVector(2).assign(-1),
        new DenseVector(2).assign(1), 2));
    return new ClusterClassifier(models);
  }
View Full Code Here

    return new ClusterClassifier(models, new FuzzyKMeansClusteringPolicy());
  }
 
  private static ClusterClassifier newGaussianClassifier() {
    List<Cluster> models = Lists.newArrayList();
    models.add(new GaussianCluster(new DenseVector(2).assign(1), new DenseVector(2).assign(1), 0));
    models.add(new GaussianCluster(new DenseVector(2), new DenseVector(2).assign(1), 1));
    models.add(new GaussianCluster(new DenseVector(2).assign(-1), new DenseVector(2).assign(1), 2));
    return new ClusterClassifier(models, new DirichletClusteringPolicy(3, 1.0));
  }
View Full Code Here

TOP

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

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.