Examples of attributeSparse()


Examples of weka.core.Instance.attributeSparse()

      for (int j = 0; j < getInputFormat().numInstances(); j++) {
  Instance inst = getInputFormat().instance(j);
  for (int i = 0; i < inst.numValues(); i++) {
    if (!inst.isMissingSparse(i)) {
      double value = inst.valueSparse(i);
      if (inst.attributeSparse(i).isNominal()) {
              if (counts[inst.index(i)].length > 0) {
                counts[inst.index(i)][(int)value] += inst.weight();
                counts[inst.index(i)][0] -= inst.weight();
              }
      } else if (inst.attributeSparse(i).isNumeric()) {
View Full Code Here

Examples of weka.core.Instance.attributeSparse()

      if (inst.attributeSparse(i).isNominal()) {
              if (counts[inst.index(i)].length > 0) {
                counts[inst.index(i)][(int)value] += inst.weight();
                counts[inst.index(i)][0] -= inst.weight();
              }
      } else if (inst.attributeSparse(i).isNumeric()) {
        results[inst.index(i)] += inst.weight() * inst.valueSparse(i);
      }
    } else {
      if (inst.attributeSparse(i).isNominal()) {
              if (counts[inst.index(i)].length > 0) {
View Full Code Here

Examples of weka.core.Instance.attributeSparse()

              }
      } else if (inst.attributeSparse(i).isNumeric()) {
        results[inst.index(i)] += inst.weight() * inst.valueSparse(i);
      }
    } else {
      if (inst.attributeSparse(i).isNominal()) {
              if (counts[inst.index(i)].length > 0) {
          counts[inst.index(i)][0] -= inst.weight();
              }
      } else if (inst.attributeSparse(i).isNumeric()) {
        sums[inst.index(i)] -= inst.weight();
View Full Code Here

Examples of weka.core.Instance.attributeSparse()

    } else {
      if (inst.attributeSparse(i).isNominal()) {
              if (counts[inst.index(i)].length > 0) {
          counts[inst.index(i)][0] -= inst.weight();
              }
      } else if (inst.attributeSparse(i).isNumeric()) {
        sums[inst.index(i)] -= inst.weight();
      }
    }
  }
      }
View Full Code Here

Examples of weka.core.Instance.attributeSparse()

      for (int j = 0; j < getInputFormat().numInstances(); j++) {
  Instance inst = getInputFormat().instance(j);
  for (int i = 0; i < inst.numValues(); i++) {
    if (!inst.isMissingSparse(i)) {
      double value = inst.valueSparse(i);
      if (inst.attributeSparse(i).isNominal()) {
        counts[inst.index(i)][(int)value] += inst.weight();
        counts[inst.index(i)][0] -= inst.weight();
      } else if (inst.attributeSparse(i).isNumeric()) {
        results[inst.index(i)] += inst.weight() * inst.valueSparse(i);
      }
View Full Code Here

Examples of weka.core.Instance.attributeSparse()

    if (!inst.isMissingSparse(i)) {
      double value = inst.valueSparse(i);
      if (inst.attributeSparse(i).isNominal()) {
        counts[inst.index(i)][(int)value] += inst.weight();
        counts[inst.index(i)][0] -= inst.weight();
      } else if (inst.attributeSparse(i).isNumeric()) {
        results[inst.index(i)] += inst.weight() * inst.valueSparse(i);
      }
    } else {
      if (inst.attributeSparse(i).isNominal()) {
        counts[inst.index(i)][0] -= inst.weight();
View Full Code Here

Examples of weka.core.Instance.attributeSparse()

        counts[inst.index(i)][0] -= inst.weight();
      } else if (inst.attributeSparse(i).isNumeric()) {
        results[inst.index(i)] += inst.weight() * inst.valueSparse(i);
      }
    } else {
      if (inst.attributeSparse(i).isNominal()) {
        counts[inst.index(i)][0] -= inst.weight();
      } else if (inst.attributeSparse(i).isNumeric()) {
        sums[inst.index(i)] -= inst.weight();
      }
    }
View Full Code Here

Examples of weka.core.Instance.attributeSparse()

        results[inst.index(i)] += inst.weight() * inst.valueSparse(i);
      }
    } else {
      if (inst.attributeSparse(i).isNominal()) {
        counts[inst.index(i)][0] -= inst.weight();
      } else if (inst.attributeSparse(i).isNumeric()) {
        sums[inst.index(i)] -= inst.weight();
      }
    }
  }
      }
View Full Code Here

Examples of weka.core.Instance.attributeSparse()

      for (int j = 0; j < getInputFormat().numInstances(); j++) {
  Instance inst = getInputFormat().instance(j);
  for (int i = 0; i < inst.numValues(); i++) {
    if (!inst.isMissingSparse(i)) {
      double value = inst.valueSparse(i);
      if (inst.attributeSparse(i).isNominal()) {
              if (counts[inst.index(i)].length > 0) {
                counts[inst.index(i)][(int)value] += inst.weight();
                counts[inst.index(i)][0] -= inst.weight();
              }
      } else if (inst.attributeSparse(i).isNumeric()) {
View Full Code Here

Examples of weka.core.Instance.attributeSparse()

      if (inst.attributeSparse(i).isNominal()) {
              if (counts[inst.index(i)].length > 0) {
                counts[inst.index(i)][(int)value] += inst.weight();
                counts[inst.index(i)][0] -= inst.weight();
              }
      } else if (inst.attributeSparse(i).isNumeric()) {
        results[inst.index(i)] += inst.weight() * inst.valueSparse(i);
      }
    } else {
      if (inst.attributeSparse(i).isNominal()) {
              if (counts[inst.index(i)].length > 0) {
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.