Package org.apache.mahout.common

Examples of org.apache.mahout.common.StringTuple.stringAt()


      return cmp;
    }

    // label or empty.
    tmpa = ta.length() == 2 ? "" : ta.stringAt(1);
    tmpb = tb.length() == 2 ? "" : tb.stringAt(1);
   
    return tmpa.compareTo(tmpb);
  }
 
}
View Full Code Here


                                                                   null,
                                                                   true,
                                                                   conf)) {
      StringTuple key = record.getFirst();
      DoubleWritable value = record.getSecond();
      datastore.loadFeatureWeight(key.stringAt(2), key.stringAt(1), value.get());
    }
  }
 
  public static void loadFeatureWeights(InMemoryBayesDatastore datastore, Path pathPattern, Configuration conf) {
    // the key is either _label_ or label,feature
View Full Code Here

                                                                   null,
                                                                   true,
                                                                   conf)) {
      StringTuple key = record.getFirst();
      DoubleWritable value = record.getSecond();
      datastore.loadFeatureWeight(key.stringAt(2), key.stringAt(1), value.get());
    }
  }
 
  public static void loadFeatureWeights(InMemoryBayesDatastore datastore, Path pathPattern, Configuration conf) {
    // the key is either _label_ or label,feature
View Full Code Here

                                                                   true,
                                                                   conf)) {
      // Sum of weights for a Feature
      StringTuple key = record.getFirst();
      DoubleWritable value = record.getSecond();
      if (key.stringAt(0).equals(BayesConstants.FEATURE_SUM)) {
        datastore.setSumFeatureWeight(key.stringAt(1), value.get());
        if (++count % 50000 == 0) {
          log.info("Read {} feature weights", count);
        }
      }
View Full Code Here

                                                                   conf)) {
      // Sum of weights for a Feature
      StringTuple key = record.getFirst();
      DoubleWritable value = record.getSecond();
      if (key.stringAt(0).equals(BayesConstants.FEATURE_SUM)) {
        datastore.setSumFeatureWeight(key.stringAt(1), value.get());
        if (++count % 50000 == 0) {
          log.info("Read {} feature weights", count);
        }
      }
    }
View Full Code Here

                                                                   true,
                                                                   conf)) {
      // Sum of weights in a Label
      StringTuple key = record.getFirst();
      DoubleWritable value = record.getSecond();
      if (key.stringAt(0).equals(BayesConstants.LABEL_SUM)) {
        datastore.setSumLabelWeight(key.stringAt(1), value.get());
        if (++count % 10000 == 0) {
          log.info("Read {} label weights", count);
        }
      }
View Full Code Here

                                                                   conf)) {
      // Sum of weights in a Label
      StringTuple key = record.getFirst();
      DoubleWritable value = record.getSecond();
      if (key.stringAt(0).equals(BayesConstants.LABEL_SUM)) {
        datastore.setSumLabelWeight(key.stringAt(1), value.get());
        if (++count % 10000 == 0) {
          log.info("Read {} label weights", count);
        }
      }
    }
View Full Code Here

                                                                   true,
                                                                   conf)) {
      StringTuple key = record.getFirst();
      DoubleWritable value = record.getSecond();
      // Sum of weights in a Label
      if (key.stringAt(0).equals(BayesConstants.LABEL_THETA_NORMALIZER)) {
        datastore.setThetaNormalizer(key.stringAt(1), value.get());
        if (++count % 50000 == 0) {
          log.info("Read {} theta norms", count);
        }
      }
View Full Code Here

                                                                   conf)) {
      StringTuple key = record.getFirst();
      DoubleWritable value = record.getSecond();
      // Sum of weights in a Label
      if (key.stringAt(0).equals(BayesConstants.LABEL_THETA_NORMALIZER)) {
        datastore.setThetaNormalizer(key.stringAt(1), value.get());
        if (++count % 50000 == 0) {
          log.info("Read {} theta norms", count);
        }
      }
    }
View Full Code Here

                                                                   null,
                                                                   true,
                                                                   conf)) {
      StringTuple key = record.getFirst();
      DoubleWritable value = record.getSecond();
      if (key.stringAt(0).equals(BayesConstants.TOTAL_SUM)) {
        // Sum of weights for all Features and all Labels
        datastore.setSigmaJSigmaK(value.get());
        log.info("{}", value.get());
      }
    }
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.