Package org.apache.mahout.common

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


      log.info("{}", path);
      SequenceFile.Reader reader = new SequenceFile.Reader(fs, path, conf);

      long count = 0;
      while (reader.next(key, value)) {
        if (key.stringAt(0).equals(BayesConstants.LABEL_SUM)) { // Sum of
                                                                // weights in a
                                                                // Label
          datastore.setSumLabelWeight(key.stringAt(1), value.get());
          count++;
          if (count % 10000 == 0) {
View Full Code Here


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

      log.info("{}", path);
      SequenceFile.Reader reader = new SequenceFile.Reader(fs, path, conf);

      long count = 0;
      while (reader.next(key, value)) {
        if (key.stringAt(0).equals(BayesConstants.LABEL_THETA_NORMALIZER)) { // Sum
                                                                             // of
                                                                             // weights
                                                                             // in
                                                                             // a
                                                                             // Label
View Full Code Here

                                                                             // of
                                                                             // weights
                                                                             // in
                                                                             // a
                                                                             // Label
          datastore.setThetaNormalizer(key.stringAt(1), value.get());
          count++;
          if (count % 50000 == 0) {
            log.info("Read {} theta norms", count);
          }
        }
View Full Code Here

      SequenceFile.Reader reader = new SequenceFile.Reader(fs, path, conf);

      // the key is _label
      while (reader.next(key, value)) {

        if (key.stringAt(0).equals(BayesConstants.TOTAL_SUM)) { // Sum of
                                                                // weights for
          // all Features and all Labels
          datastore.setSigma_jSigma_k(value.get());
          log.info("{}", value.get());
        }
View Full Code Here

    for (FileStatus fileStatus : outputFiles) {
      Path path = fileStatus.getPath();
      SequenceFile.Reader reader = new SequenceFile.Reader(fs, path, conf);
      // the key is either _label_ or label,feature
      while (reader.next(key, value)) {
        if (key.stringAt(0).equals(BayesConstants.LABEL_SUM)) { // Sum of counts
                                                                // of labels
          labelSum.put(key.stringAt(1), value.get());
        }

      }
View Full Code Here

      SequenceFile.Reader reader = new SequenceFile.Reader(fs, path, conf);
      // the key is either _label_ or label,feature
      while (reader.next(key, value)) {
        if (key.stringAt(0).equals(BayesConstants.LABEL_SUM)) { // Sum of counts
                                                                // of labels
          labelSum.put(key.stringAt(1), value.get());
        }

      }
    }
View Full Code Here

    for (FileStatus fileStatus : outputFiles) {
      Path path = fileStatus.getPath();
      SequenceFile.Reader reader = new SequenceFile.Reader(fs, path, conf);
      // the key is either _label_ or label,feature
      while (reader.next(key, value)) {
        if (key.stringAt(0).equals(BayesConstants.LABEL_COUNT)) { // Count of
                                                                  // Documents
                                                                  // in a Label
          labelDocumentCounts.put(key.stringAt(1), value.get());
        }
View Full Code Here

      // the key is either _label_ or label,feature
      while (reader.next(key, value)) {
        if (key.stringAt(0).equals(BayesConstants.LABEL_COUNT)) { // Count of
                                                                  // Documents
                                                                  // in a Label
          labelDocumentCounts.put(key.stringAt(1), value.get());
        }

      }
    }
View Full Code Here

      SequenceFile.Reader reader = new SequenceFile.Reader(fs, path, conf);
      // the key is *
      while (reader.next(key, value)) {
        if (weightSum.size() > 1) {
          throw new IOException("Incorrect Sum File");
        } else if (key.stringAt(0).equals(BayesConstants.TOTAL_SUM)) {
          weightSum.put(BayesConstants.TOTAL_SUM, 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.