Package brickhouse.udf.sketch

Examples of brickhouse.udf.sketch.SetSimilarityUDF.evaluate()


      randomUUID = UUID.randomUUID();
      c.addItem( randomUUID.toString());
    }
    SetSimilarityUDF simUDF = new SetSimilarityUDF();
   
    double same = simUDF.evaluate(a.getMinHashItems(), a.getMinHashItems());
    System.out.println( "Similarity with self = " + same);
    Assert.assertEquals( 1.0, same, 0);
   
    double diff = simUDF.evaluate(a.getMinHashItems(), b.getMinHashItems());
    System.out.println( "Similarity with different  = " + diff);
View Full Code Here


   
    double same = simUDF.evaluate(a.getMinHashItems(), a.getMinHashItems());
    System.out.println( "Similarity with self = " + same);
    Assert.assertEquals( 1.0, same, 0);
   
    double diff = simUDF.evaluate(a.getMinHashItems(), b.getMinHashItems());
    System.out.println( "Similarity with different  = " + diff);
    Assert.assertEquals( 0, diff , 0.03); /// Might not be quite zero
   
    a.combine(c);
    b.combine(c);
View Full Code Here

    Assert.assertEquals( 0, diff , 0.03); /// Might not be quite zero
   
    a.combine(c);
    b.combine(c);
   
    double mixed = simUDF.evaluate( a.getMinHashItems(), b.getMinHashItems());
    System.out.println("Similarity with mixed = " +mixed);
    //// Should be about a third
    Assert.assertEquals( 0.333333333, mixed, 0.03);
   
  }
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.