Package cz.zcu.fav.liks.math

Examples of cz.zcu.fav.liks.math.SparseVector


    tokenLabelCounts = new HashMap<Integer, HashMap<Integer, Integer>>();

    tfvl.reset();
    while (tfvl.hasNext()) {

      SparseVector vector = tfvl.next();
      int label = tfvl.getLabel(0);

      double[] values = vector.getNonZeroValues();
      int[] indicies = vector.getNonZeroIndeces();

      if (labelCounts.get(label) != null) {
        labelCounts.put(label, labelCounts.get(label) + 1);
      } else {
        labelCounts.put(label, 1);
View Full Code Here


  private double extractUnwantedFeatures(TrainingFeatureVectorList tfvl, double minWeight) {
    int pos = 0;
    int neg = 0;
    tfvl.reset();
    while (tfvl.hasNext()) {
      SparseVector vector = tfvl.next();
      int[] indicies = vector.getNonZeroIndeces();

      for (int i = 0; i < indicies.length; i++) {
        if (weights.get(indicies[i]) < minWeight) {
          vector.set(indicies[i], 0);
          neg++;
        } else {
          pos++;
        }
      }
View Full Code Here

TOP

Related Classes of cz.zcu.fav.liks.math.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.