Examples of MutableLong


Examples of org.apache.commons.lang.mutable.MutableLong

    //int count = 0;
    while (transactions.hasNext()) {
      List<A> transaction = transactions.next();
      for (A attribute : transaction) {
        if (AttributeSupport.containsKey(attribute) == false)
          AttributeSupport.put(attribute, new MutableLong(1));
        else
          AttributeSupport.get(attribute).increment();
        //count++;
      }
    }
View Full Code Here

Examples of org.apache.commons.lang.mutable.MutableLong

    for (int i = tree.getHeaderTableCount() - 1; i >= 0; i--) {
      int attribute = tree.getAttributeAtIndex(i);
      if (requiredFeatures.contains(attribute) == false)
        continue;
      log.info("Mining FTree Tree for all patterns with {}", attribute);
      MutableLong minSupport = new MutableLong(minSupportValue);
      FrequentPatternMaxHeap frequentPatterns = growth(tree, minSupport, K,
          treeCache, 0, attribute);
      Patterns.put(attribute, frequentPatterns);
      outputCollector.collect(attribute, frequentPatterns);

      minSupportValue = Math.max(minSupportValue, minSupport.intValue() / 2);
      log.info("Found {} Patterns with Least Support {}", Patterns.get(
          attribute).count(), Patterns.get(attribute).leastSupport());
    }
    log.info("Tree Cache: First Level: Cache hits={} Cache Misses={}",
        treeCache.getHits(), treeCache.getMisses());
View Full Code Here

Examples of org.apache.commons.lang.mutable.MutableLong

    for (int i = 0; i < featureSetSize; i++) {
      tree.addHeaderCount(i, attributeFrequency[i]);
    }

    // Constructing initial FPTree from the list of transactions
    MutableLong minSupportMutable = new MutableLong(minSupport);
    int nodecount = 0;
    //int attribcount = 0;
    int i = 0;
    while (transactions.hasNext()) {
      int[] transaction = transactions.next();
View Full Code Here

Examples of org.apache.commons.lang.mutable.MutableLong

      Pair<List<A>,Long> transaction = transactions.next();
      for (A attribute : transaction.getFirst()) {
        if (attributeSupport.containsKey(attribute)) {
          attributeSupport.get(attribute).add(transaction.getSecond().longValue());
        } else {
          attributeSupport.put(attribute, new MutableLong(transaction.getSecond()));
        }
      }
    }
    List<Pair<A,Long>> fList = new ArrayList<Pair<A,Long>>();
    for (Entry<A,MutableLong> e : attributeSupport.entrySet()) {
View Full Code Here

Examples of org.apache.commons.lang.mutable.MutableLong

    FPTreeDepthCache treeCache = new FPTreeDepthCache();
    for (int i = tree.getHeaderTableCount() - 1; i >= 0; i--) {
      int attribute = tree.getAttributeAtIndex(i);
      if (requiredFeatures.contains(attribute)) {
        log.info("Mining FTree Tree for all patterns with {}", attribute);
        MutableLong minSupport = new MutableLong(minSupportValue);
        FrequentPatternMaxHeap frequentPatterns = growth(tree, minSupport, k,
                                                         treeCache, 0, attribute, updater);
        patterns.put(attribute, frequentPatterns);
        outputCollector.collect(attribute, frequentPatterns);

        minSupportValue = Math.max(minSupportValue, minSupport.longValue() / 2);
        log.info("Found {} Patterns with Least Support {}", patterns.get(
            attribute).count(), patterns.get(attribute).leastSupport());
      }
    }
    log.info("Tree Cache: First Level: Cache hits={} Cache Misses={}",
View Full Code Here

Examples of org.apache.commons.lang.mutable.MutableLong

      Pair<List<Integer>,Long> p = it.next();
      //items += p.getFirst().size();
      //count++;
      for (Integer i : p.getFirst()) {
        if (!frequencyList.containsKey(i)) {
          frequencyList.put(i, new MutableLong(0));
        }
        frequencyList.get(i).add(p.getSecond());
      }
    }
    return frequencyList;
View Full Code Here

Examples of org.apache.commons.lang.mutable.MutableLong

   
    @SuppressWarnings("unchecked")
    Map<ByteSequence,MutableLong>[] groups = new Map[2];
   
    groups[0] = new HashMap<ByteSequence,MutableLong>();
    groups[0].put(new ArrayByteSequence("cf1"), new MutableLong(1));
    groups[0].put(new ArrayByteSequence("cf2"), new MutableLong(1));
   
    groups[1] = new HashMap<ByteSequence,MutableLong>();
    groups[1].put(new ArrayByteSequence("cf3"), new MutableLong(1));
   
    Partitioner p1 = new Partitioner(groups);
   
    Mutation m1 = new Mutation("r1");
    m1.put("cf1", "cq1", "v1");
View Full Code Here

Examples of org.apache.commons.lang3.mutable.MutableLong

    public void addValue(T val) {
        addValue(val, 1L);
    }

    private void updateValueCount(T actualValue, long sampleCount) {
        MutableLong count = valuesMap.get(actualValue);
        if (count != null) {
            count.add(sampleCount);
        } else {
            // insert new value
            valuesMap.put(actualValue, new MutableLong(sampleCount));
        }
    }
View Full Code Here

Examples of org.apache.commons.lang3.mutable.MutableLong

    Map<Integer,FrequentPatternMaxHeap> patterns = Maps.newHashMap();
    requiredFeatures.sort();
    for (int attribute : tree.attrIterableRev()) {
      if (requiredFeatures.binarySearch(attribute) >= 0) {
        log.info("Mining FTree Tree for all patterns with {}", attribute);
        MutableLong minSupport = new MutableLong(minSupportValue);
        FrequentPatternMaxHeap frequentPatterns = growth(tree, minSupport, k,
                                                         attribute, updater);
        patterns.put(attribute, frequentPatterns);
        outputCollector.collect(attribute, frequentPatterns);

        minSupportValue = Math.max(minSupportValue, minSupport.longValue() / 2);
        log.info("Found {} Patterns with Least Support {}", patterns.get(
            attribute).count(), patterns.get(attribute).leastSupport());
      }
    }
    return patterns;
View Full Code Here

Examples of org.apache.commons.lang3.mutable.MutableLong

      Pair<List<A>,Long> transaction = transactions.next();
      for (A attribute : transaction.getFirst()) {
        if (attributeSupport.containsKey(attribute)) {
          attributeSupport.get(attribute).add(transaction.getSecond().longValue());
        } else {
          attributeSupport.put(attribute, new MutableLong(transaction.getSecond()));
        }
      }
    }
    List<Pair<A,Long>> fList = Lists.newArrayList();
    for (Entry<A,MutableLong> e : attributeSupport.entrySet()) {
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.