Package org.apache.mahout.clustering.canopy

Examples of org.apache.mahout.clustering.canopy.Canopy.asFormatString()


  public void testCanopyAsFormatString() {
    double[] d = { 1.1, 2.2, 3.3 };
    Vector m = new DenseVector(d);
    Printable cluster = new Canopy(m, 123);
    String formatString = cluster.asFormatString(null);
    System.out.println(formatString);
    assertEquals("format", "C123: [1.100, 2.200, 3.300]", formatString);
  }

  public void testCanopyAsFormatStringSparse() {
View Full Code Here


  public void testCanopyAsFormatStringSparse() {
    double[] d = { 1.1, 0.0, 3.3 };
    Vector m = new SequentialAccessSparseVector(3);
    m.assign(d);
    Printable cluster = new Canopy(m, 123);
    String formatString = cluster.asFormatString(null);
    System.out.println(formatString);
    assertEquals("format", "C123: [0:1.100, 2:3.300]", formatString);
  }

  public void testCanopyAsFormatStringWithBindings() {
View Full Code Here

  public void testCanopyAsFormatStringWithBindings() {
    double[] d = { 1.1, 2.2, 3.3 };
    Vector m = new DenseVector(d);
    Printable cluster = new Canopy(m, 123);
    String[] bindings = { "fee", null, null };
    String formatString = cluster.asFormatString(bindings);
    System.out.println(formatString);
    assertEquals("format", "C123: [fee:1.100, 1:2.200, 2:3.300]", formatString);
  }

  public void testCanopyAsFormatStringSparseWithBindings() {
View Full Code Here

  public void testCanopyAsFormatStringSparseWithBindings() {
    double[] d = { 1.1, 0.0, 3.3 };
    Vector m = new SequentialAccessSparseVector(3);
    m.assign(d);
    Printable cluster = new Canopy(m, 123);
    String formatString = cluster.asFormatString(null);
    System.out.println(formatString);
    assertEquals("format", "C123: [0:1.100, 2:3.300]", formatString);
  }

  public void testClusterAsFormatString() {
View Full Code Here

  @Test
  public void testCanopyAsFormatString() {
    double[] d = { 1.1, 2.2, 3.3 };
    Vector m = new DenseVector(d);
    Cluster cluster = new Canopy(m, 123, measure);
    String formatString = cluster.asFormatString(null);
    System.out.println(formatString);
    assertEquals("format", "C-123{n=0 c=[1.100, 2.200, 3.300] r=[]}", formatString);
  }

  @Test
View Full Code Here

  public void testCanopyAsFormatStringSparse() {
    double[] d = { 1.1, 0.0, 3.3 };
    Vector m = new SequentialAccessSparseVector(3);
    m.assign(d);
    Cluster cluster = new Canopy(m, 123, measure);
    String formatString = cluster.asFormatString(null);
    System.out.println(formatString);
    assertEquals("format", "C-123{n=0 c=[0:1.100, 2:3.300] r=[]}", formatString);
  }

  @Test
View Full Code Here

  public void testCanopyAsFormatStringWithBindings() {
    double[] d = { 1.1, 2.2, 3.3 };
    Vector m = new DenseVector(d);
    Cluster cluster = new Canopy(m, 123, measure);
    String[] bindings = { "fee", null, null };
    String formatString = cluster.asFormatString(bindings);
    System.out.println(formatString);
    assertEquals("format", "C-123{n=0 c=[fee:1.100, 1:2.200, 2:3.300] r=[]}", formatString);
  }

  @Test
View Full Code Here

  public void testCanopyAsFormatStringSparseWithBindings() {
    double[] d = { 1.1, 0.0, 3.3 };
    Vector m = new SequentialAccessSparseVector(3);
    m.assign(d);
    Cluster cluster = new Canopy(m, 123, measure);
    String formatString = cluster.asFormatString(null);
    System.out.println(formatString);
    assertEquals("format", "C-123{n=0 c=[0:1.100, 2:3.300] r=[]}", formatString);
  }

  @Test
View Full Code Here

  @Test
  public void testCanopyAsFormatString() {
    double[] d = { 1.1, 2.2, 3.3 };
    Vector m = new DenseVector(d);
    Cluster cluster = new Canopy(m, 123, measure);
    String formatString = cluster.asFormatString(null);
    assertEquals("C-123{n=0 c=[1.100, 2.200, 3.300] r=[]}", formatString);
  }

  @Test
  public void testCanopyAsFormatStringSparse() {
View Full Code Here

  public void testCanopyAsFormatStringSparse() {
    double[] d = { 1.1, 0.0, 3.3 };
    Vector m = new SequentialAccessSparseVector(3);
    m.assign(d);
    Cluster cluster = new Canopy(m, 123, measure);
    String formatString = cluster.asFormatString(null);
    assertEquals("C-123{n=0 c=[0:1.100, 2:3.300] r=[]}", formatString);
  }

  @Test
  public void testCanopyAsFormatStringWithBindings() {
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.