Examples of stringAt()


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

   
    for (FileStatus fileStatus : outputFiles) {
      Path path = fileStatus.getPath();
      SequenceFile.Reader reader = new SequenceFile.Reader(fs, path, conf);
      while (reader.next(key, value)) {
        String correctLabel = key.stringAt(1);
        String classifiedLabel = key.stringAt(2);
        Map<String,Integer> rowMatrix = confusionMatrix.get(correctLabel);
        if (rowMatrix == null) {
          rowMatrix = new HashMap<String,Integer>();
        }
View Full Code Here

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

    for (FileStatus fileStatus : outputFiles) {
      Path path = fileStatus.getPath();
      SequenceFile.Reader reader = new SequenceFile.Reader(fs, path, conf);
      while (reader.next(key, value)) {
        String correctLabel = key.stringAt(1);
        String classifiedLabel = key.stringAt(2);
        Map<String,Integer> rowMatrix = confusionMatrix.get(correctLabel);
        if (rowMatrix == null) {
          rowMatrix = new HashMap<String,Integer>();
        }
        Integer count = Double.valueOf(value.get()).intValue();
View Full Code Here

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

    StringTuple tb = (StringTuple) b;
    Preconditions.checkArgument(ta.length() >= 2 && ta.length() <= 3 && tb.length() >= 2 && tb.length() <= 3,
                                "StringTuple length out of bounds");
    // token
    String tmpa = ta.length() == 2 ? ta.stringAt(1) : ta.stringAt(2);
    String tmpb = tb.length() == 2 ? tb.stringAt(1) : tb.stringAt(2);
    int cmp = tmpa.compareTo(tmpb);
    if (cmp != 0) {
      return cmp;
    }
   
View Full Code Here

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

    StringTuple tb = (StringTuple) b;
    Preconditions.checkArgument(ta.length() >= 2 && ta.length() <= 3 && tb.length() >= 2 && tb.length() <= 3,
                                "StringTuple length out of bounds");
    // token
    String tmpa = ta.length() == 2 ? ta.stringAt(1) : ta.stringAt(2);
    String tmpb = tb.length() == 2 ? tb.stringAt(1) : tb.stringAt(2);
    int cmp = tmpa.compareTo(tmpb);
    if (cmp != 0) {
      return cmp;
    }
   
View Full Code Here

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

    if (cmp != 0) {
      return cmp;
    }
   
    // type, FEATURE_TF first, then FEATURE_COUNT, then DF or anything else.
    cmp = ta.stringAt(0).compareTo(tb.stringAt(0));
    if (cmp != 0) {
      if (ta.stringAt(0).equals(BayesConstants.FEATURE_TF)) {
        return -1;
      }
      if (tb.stringAt(0).equals(BayesConstants.FEATURE_TF)) {
View Full Code Here

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

    cmp = ta.stringAt(0).compareTo(tb.stringAt(0));
    if (cmp != 0) {
      if (ta.stringAt(0).equals(BayesConstants.FEATURE_TF)) {
        return -1;
      }
      if (tb.stringAt(0).equals(BayesConstants.FEATURE_TF)) {
        return 1;
      }
      if (ta.stringAt(0).equals(BayesConstants.FEATURE_COUNT)) {
        return -1;
      }
View Full Code Here

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

        return 1;
      }
      if (ta.stringAt(0).equals(BayesConstants.FEATURE_COUNT)) {
        return -1;
      }
      if (tb.stringAt(0).equals(BayesConstants.FEATURE_COUNT)) {
        return 1;
      }
      return cmp;
    }
View Full Code Here

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

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

                                                                   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

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

                                                                   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
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.