Package types

Examples of types.SparseVector


    int numFeats = 5;
    double randomFrac = 0.5;
    double missingFrac = 0.5;
    for (int instInd = 0; instInd < 10; instInd++) {
      String label = classes[r.nextInt(classes.length)];
      SparseVector sv = new SparseVector();
      for (int fInd = 0; fInd < numFeats; fInd++) {
        if (r.nextDouble() < missingFrac)
          continue;
        String tmpLab = label;
        if (r.nextDouble() < randomFrac)
          tmpLab = classes[r.nextInt(classes.length)];
        sv.add(xAlphabet.lookupObject(tmpLab + fInd), 1);
      }
      train.add(new ClassificationInstance(xAlphabet, yAlphabet, sv,
          label));
    }
    AdaBoost boost = new AdaBoost(10, xAlphabet, yAlphabet,
View Full Code Here

TOP

Related Classes of types.SparseVector

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.