test_class.declarator: random = new Random()
test_class.modifier: private
test_class.original_string: private Random random = new Random();
test_class.type: Random
test_class.var_name: random
test_class.declarator: zipf
test_class.modifier: private
test_class.original_string: private ZipfDistribution zipf;
test_class.type: ZipfDistribution
test_class.var_name: zipf
test_class.file: ml/streaminer/src/test/java/org/streaminer/stream/frequency/AMSSketchTest.java
test_class.identifier: AMSSketchTest
test_case.body: @Test
      public void testAdd() {
          int n = 1048575;
          int range = 12345;
          
          AMSSketch sketch = new AMSSketch(5, 512);
          StreamGenerator gen = new StreamGenerator(0.8, n, range);
          gen.generate();
          gen.exact();
          
          long[] stream = gen.stream;
          long sumsq = gen.sumsq;
          
          for (int i=1; i<=range; i++) 
              sketch.add(stream[i], 1);  
          
          // actual frequency
          RealCounting<Long> actualFreq = new RealCounting<Long>();
          for (int i=1; i<=range; i++)
              actualFreq.add(stream[i], 1);      
          
          List<CountEntry<Long>> topk = actualFreq.peek(10);
          
          System.out.println("Frequency Table\n" + StringUtils.repeat("-", 80));
          System.out.println("Item\tactual\testimated");
          for (CountEntry<Long> item : topk) {
              System.out.println(item.getItem() + "\t" 
                      + item.getFrequency() + "\t" 
                      + sketch.estimateCount(item.getItem()));
          }
          
          System.out.println("Exact F2: " + sumsq);
          System.out.println("Estimated F2: " + sketch.estimateF2());
      }
test_case.class_method_signature: AMSSketchTest.testAdd()
test_case.full_signature: @Test public void testAdd()
test_case.identifier: testAdd
test_case.invocations: generate exact add add peek println repeat println println getItem getFrequency estimateCount getItem println println estimateF2
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testAdd()
focal_class.declarator: depth
focal_class.modifier: private
focal_class.original_string: private int depth;
focal_class.type: int
focal_class.var_name: depth
focal_class.declarator: buckets
focal_class.modifier: private
focal_class.original_string: private int buckets;
focal_class.type: int
focal_class.var_name: buckets
focal_class.declarator: count = 0
focal_class.modifier: private
focal_class.original_string: private int count = 0;
focal_class.type: int
focal_class.var_name: count
focal_class.declarator: counts
focal_class.modifier: private
focal_class.original_string: private int[] counts;
focal_class.type: int[]
focal_class.var_name: counts
focal_class.declarator: test
focal_class.modifier: private
focal_class.original_string: private long[][] test;
focal_class.type: long[][]
focal_class.var_name: test
focal_class.declarator: prng = new SecureRandom()
focal_class.modifier: private
focal_class.original_string: private SecureRandom prng = new SecureRandom();
focal_class.type: SecureRandom
focal_class.var_name: prng
focal_class.file: ml/streaminer/src/main/java/org/streaminer/stream/frequency/AMSSketch.java
focal_class.identifier: AMSSketch
focal_class.interfaces: implements ISimpleFrequency<Long>, Comparable<AMSSketch>
focal_class.class_method_signature: AMSSketch.AMSSketch(int depth, int buckets)
focal_class.full_signature: public  AMSSketch(int depth, int buckets)
focal_class.identifier: AMSSketch
focal_class.modifiers: public
focal_class.parameters: (int depth, int buckets)
focal_class.signature:  AMSSketch(int depth, int buckets)
focal_class.class_method_signature: AMSSketch.add(Long item)
focal_class.full_signature: public boolean add(Long item)
focal_class.identifier: add
focal_class.modifiers: public
focal_class.parameters: (Long item)
focal_class.return: boolean
focal_class.signature: boolean add(Long item)
focal_class.class_method_signature: AMSSketch.add(Long item, long incrementCount)
focal_class.full_signature: public boolean add(Long item, long incrementCount)
focal_class.identifier: add
focal_class.modifiers: public
focal_class.parameters: (Long item, long incrementCount)
focal_class.return: boolean
focal_class.signature: boolean add(Long item, long incrementCount)
focal_class.class_method_signature: AMSSketch.compareTo(AMSSketch o)
focal_class.full_signature: public int compareTo(AMSSketch o)
focal_class.identifier: compareTo
focal_class.modifiers: public
focal_class.parameters: (AMSSketch o)
focal_class.return: int
focal_class.signature: int compareTo(AMSSketch o)
focal_class.class_method_signature: AMSSketch.estimateCount(Long item)
focal_class.full_signature: public long estimateCount(Long item)
focal_class.identifier: estimateCount
focal_class.modifiers: public
focal_class.parameters: (Long item)
focal_class.return: long
focal_class.signature: long estimateCount(Long item)
focal_class.class_method_signature: AMSSketch.size()
focal_class.full_signature: public long size()
focal_class.identifier: size
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long size()
focal_class.class_method_signature: AMSSketch.estimateF2()
focal_class.full_signature: public long estimateF2()
focal_class.identifier: estimateF2
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long estimateF2()
focal_class.class_method_signature: AMSSketch.innerProduct(AMSSketch b)
focal_class.full_signature: public long innerProduct(AMSSketch b)
focal_class.identifier: innerProduct
focal_class.modifiers: public
focal_class.parameters: (AMSSketch b)
focal_class.return: long
focal_class.signature: long innerProduct(AMSSketch b)
focal_class.class_method_signature: AMSSketch.add(AMSSketch source)
focal_class.full_signature: public boolean add(AMSSketch source)
focal_class.identifier: add
focal_class.modifiers: public
focal_class.parameters: (AMSSketch source)
focal_class.return: boolean
focal_class.signature: boolean add(AMSSketch source)
focal_class.class_method_signature: AMSSketch.subtract(AMSSketch source)
focal_class.full_signature: public boolean subtract(AMSSketch source)
focal_class.identifier: subtract
focal_class.modifiers: public
focal_class.parameters: (AMSSketch source)
focal_class.return: boolean
focal_class.signature: boolean subtract(AMSSketch source)
focal_class.class_method_signature: AMSSketch.contains(Long item)
focal_class.full_signature: public boolean contains(Long item)
focal_class.identifier: contains
focal_class.modifiers: public
focal_class.parameters: (Long item)
focal_class.return: boolean
focal_class.signature: boolean contains(Long item)
focal_method.body: public boolean add(Long item) {
          return add(item, 1);
      }
focal_method.class_method_signature: AMSSketch.add(Long item)
focal_method.full_signature: public boolean add(Long item)
focal_method.identifier: add
focal_method.invocations: add
focal_method.modifiers: public
focal_method.parameters: (Long item)
focal_method.return: boolean
focal_method.signature: boolean add(Long item)