Examples of weight()


Examples of weka.core.Attribute.weight()

                                     4, 2) + "\n\n");
    Enumeration enumAtts = m_Instances.enumerateAttributes();
    int attIndex = 0;
    while (enumAtts.hasMoreElements()) {
      Attribute attribute = (Attribute) enumAtts.nextElement();
      if (attribute.weight() > 0) {
        text.append(attribute.name() + ":  "
                          + m_Distributions[attIndex][i]);
      }
      attIndex++;
    }
View Full Code Here

Examples of weka.core.Instance.weight()

      m_MaxTarget = -Double.MAX_VALUE;

      for (int i = 0; i < train.numInstances(); i++) {
        Instance currentInst = train.instance(i);
        if (!currentInst.classIsMissing()) {
          addNumericTrainClass(currentInst.classValue(), currentInst.weight());
        }
      }

      m_ClassPriors[0] = m_ClassPriorsSum = 0;
      for (int i = 0; i < train.numInstances(); i++) {
View Full Code Here

Examples of weka.core.Instance.weight()

  for (int j = 0; j < insts.numInstances(); j++) {
    Instance inst = insts.instance(j);
    if (!inst.isMissing(i) && !inst.classIsMissing()) {
      double xDiff = inst.value(i) - xMean;
      double yDiff = inst.classValue() - yMean;
      double weightedXDiff = inst.weight() * xDiff;
      double weightedYDiff = inst.weight() * yDiff;
      m_slope += weightedXDiff * yDiff;
      sumWeightedXDiffSquared += weightedXDiff * xDiff;
      sumWeightedYDiffSquared += weightedYDiff * yDiff;
    }
View Full Code Here

Examples of weka.core.Instance.weight()

    Instance inst = insts.instance(j);
    if (!inst.isMissing(i) && !inst.classIsMissing()) {
      double xDiff = inst.value(i) - xMean;
      double yDiff = inst.classValue() - yMean;
      double weightedXDiff = inst.weight() * xDiff;
      double weightedYDiff = inst.weight() * yDiff;
      m_slope += weightedXDiff * yDiff;
      sumWeightedXDiffSquared += weightedXDiff * xDiff;
      sumWeightedYDiffSquared += weightedYDiff * yDiff;
    }
  }
View Full Code Here

Examples of weka.core.Instance.weight()

    double[] vals = new double[2];
    vals[0] = SVMOutput(-1, inst);
    if (inst.classValue() == cl2) {
      vals[1] = 1;
    }
    data.add(new Instance(inst.weight(), vals));
  }
      } else {

  // Check whether number of folds too large
  if (numFolds > insts.numInstances()) {
View Full Code Here

Examples of weka.core.Instance.weight()

 
    for (int i = 0; i < nC; i++) {
      // initialize X[][]
      Instance current = train.instance(i);
      Y[i] = (int)current.classValue()// Class value starts from 0
      weights[i] = current.weight();     // Dealing with weights
      totWeights += weights[i];
     
      m_Data[i][0] = 1;
      int j = 1;
      for (int k = 0; k <= nR; k++) {
View Full Code Here

Examples of weka.core.Instance.weight()

  start++;
      }

      // create new instance
      if (oldInstance instanceof SparseInstance)
  newInstance = new SparseInstance(oldInstance.weight(), newValues);
      else
  newInstance = new Instance(oldInstance.weight(), newValues);

      // copy string/relational values from input to output
      copyValues(newInstance, false, oldInstance.dataset(), getOutputFormat());
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.