Package weka.core

Examples of weka.core.Instance.weight()


        for (l = 0; l < inst.numInstances(); l++) {
    Instance in = inst.instance(l);
          if (!in.isMissing(j)) {
            if (inst.attribute(j).isNominal()) {
              m_model[i][j].addValue(in.value(j),
             in.weight() * m_weights[l][i]);
            }
            else {
              m_modelNormal[i][j][0] += (in.value(j) * in.weight() *
           m_weights[l][i]);
              m_modelNormal[i][j][2] += in.weight() * m_weights[l][i];
 
View Full Code Here


            if (inst.attribute(j).isNominal()) {
              m_model[i][j].addValue(in.value(j),
             in.weight() * m_weights[l][i]);
            }
            else {
              m_modelNormal[i][j][0] += (in.value(j) * in.weight() *
           m_weights[l][i]);
              m_modelNormal[i][j][2] += in.weight() * m_weights[l][i];
              m_modelNormal[i][j][1] += (in.value(j) *
           in.value(j) * in.weight() * m_weights[l][i]);
            }
View Full Code Here

    }

    // collect class counts
    for (int i = 0; i < instances.numInstances(); i++) {
      Instance inst = instances.instance(i);
      m_globalCounts[(int)instances.instance(i).classValue()] += inst.weight();
      for (int j = 0; j < instances.numAttributes(); j++) {
  if (!inst.isMissing(j) && j != m_ClassIndex) {
    if (instances.attribute(j).isNumeric()) {
      double val = inst.value(j);
    
View Full Code Here

             in.weight() * m_weights[l][i]);
            }
            else {
              m_modelNormal[i][j][0] += (in.value(j) * in.weight() *
           m_weights[l][i]);
              m_modelNormal[i][j][2] += in.weight() * m_weights[l][i];
              m_modelNormal[i][j][1] += (in.value(j) *
           in.value(j) * in.weight() * m_weights[l][i]);
            }
          }
        }
View Full Code Here

            else {
              m_modelNormal[i][j][0] += (in.value(j) * in.weight() *
           m_weights[l][i]);
              m_modelNormal[i][j][2] += in.weight() * m_weights[l][i];
              m_modelNormal[i][j][1] += (in.value(j) *
           in.value(j) * in.weight() * m_weights[l][i]);
            }
          }
        }
      }
    }
View Full Code Here

      double val = inst.value(j);
    
      int k;
      for (k = m_intervalBounds[j].length-1; k >= 0; k--) {
        if (val > m_intervalBounds[j][k]) {
    m_counts[j][k][(int)inst.classValue()] += inst.weight();
    break;
        } else if (val == m_intervalBounds[j][k]) {
    m_counts[j][k][(int)inst.classValue()] +=
      (inst.weight() / 2.0);
    m_counts[j][k-1][(int)inst.classValue()] +=
View Full Code Here

    for (int l = 0; l < inst.numInstances(); l++) {

      Instance in = inst.instance(l);

      loglk += in.weight() * logDensityForInstance(in);
      sOW += in.weight();

      if (change_weights) {
  m_weights[l] = distributionForInstance(in);
      }
View Full Code Here

    for (int l = 0; l < inst.numInstances(); l++) {

      Instance in = inst.instance(l);

      loglk += in.weight() * logDensityForInstance(in);
      sOW += in.weight();

      if (change_weights) {
  m_weights[l] = distributionForInstance(in);
      }
    }
View Full Code Here

        if (val > m_intervalBounds[j][k]) {
    m_counts[j][k][(int)inst.classValue()] += inst.weight();
    break;
        } else if (val == m_intervalBounds[j][k]) {
    m_counts[j][k][(int)inst.classValue()] +=
      (inst.weight() / 2.0);
    m_counts[j][k-1][(int)inst.classValue()] +=
      (inst.weight() / 2.0);;
    break;
        }
      }
View Full Code Here

    break;
        } else if (val == m_intervalBounds[j][k]) {
    m_counts[j][k][(int)inst.classValue()] +=
      (inst.weight() / 2.0);
    m_counts[j][k-1][(int)inst.classValue()] +=
      (inst.weight() / 2.0);;
    break;
        }
      }
    
    } else {
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.