Package bgu.bio.adt.tuples

Examples of bgu.bio.adt.tuples.LongPair


  private double calculateCategory(String categoryName, String... features) {
    TLongArrayList denomList = new TLongArrayList();
    TLongArrayList numList = new TLongArrayList();

    LongPair pair = new LongPair();
    /*
     * categoryProbability(categoryName, pair); gcd(pair);
     * denomList.add(pair.getSecond()); numList.add(pair.getFirst());
     */
    Category category = categories.get(categoryName);
    for (int i = 0; i < features.length; i++) {
      pair.setFirst(category.featureOccurences(features[i]) + alpha);
      pair.setSecond(featureOccurences(features[i]) + categories.size()
          * alpha);
      gcd(pair);
      numList.add(pair.getFirst());
      denomList.add(pair.getSecond());
    }
    // count the amount of zeros in the lists

    long numerator = 1, denominator = 1;
    for (int i = 0; i < denomList.size(); i++) {
View Full Code Here

TOP

Related Classes of bgu.bio.adt.tuples.LongPair

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.