Package edu.uci.jforestsx.input

Examples of edu.uci.jforestsx.input.FeatureValuePair


  public String content;
 
  public SparseTextFileLine() {
     pairs = new FeatureValuePair[DEFAULT_MAX_PAIRS];
     for (int f = 0; f < DEFAULT_MAX_PAIRS; f++) {
       pairs[f] = new FeatureValuePair();
     }
     numPairs = 0;
  }
View Full Code Here


      FeatureValuePair[] newPairs = new FeatureValuePair[newSize];
      for (int f = 0; f < pairs.length; f++) {
        newPairs[f] = pairs[f];
      }
      for (int f = pairs.length; f < newSize; f++) {
        newPairs[f] = new FeatureValuePair();
      }
      pairs = newPairs;
    }
  }
View Full Code Here

        }
      } else {
        sb.setLength(0);
        sb.append(line.target);
        for (int i = 0; i < line.numPairs; i++) {
          FeatureValuePair pair = line.pairs[i];
          sb.append(" " + pair.featureIndex + ":" + pair.featureValue);
        }       
        sb.append("\n");
        output.print(sb.toString());
        count++;
View Full Code Here

  private void processLine(SparseTextFileLine line) {
    sb.setLength(0);
    if (dumpAsSparse) {
      sb.append("{");
      for (int i = 0; i < line.numPairs; i++) {
        FeatureValuePair pair = line.pairs[i];
        if (sb.length() > 1) {
          sb.append(",");
        }
        sb.append((pair.featureIndex - 1) + " " + pair.featureValue);
      }
      sb.append(", " + targetColIdx + " " + line.target);
      sb.append("}\n");
    } else {
      int prevFeatureIdx = 0;
      for (int i = 0; i < line.numPairs; i++) {
        FeatureValuePair pair = line.pairs[i];
        while (pair.featureIndex > prevFeatureIdx + 1) {
          if (sb.length() > 0) {
            sb.append(",");
          }
          sb.append("0");
View Full Code Here

TOP

Related Classes of edu.uci.jforestsx.input.FeatureValuePair

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.