Package weka.core

Examples of weka.core.Instance.weight()


         m_Change[x][y] = 1.0;
         */ 

      data.add(example);
      m_Class[x] = example.classValue();
      m_Weights[x] = example.weight()
    }

    for(int z=0; z < numegs; z++)
      findWeights(z, m_Mean);

View Full Code Here


  classDstr[1][j] = 0;
     
      if(m_ClassAttribute.isNominal()){     
  for(int i=0; i < growData.numInstances(); i++){
    Instance datum = growData.instance(i);
    classDstr[0][(int)datum.classValue()] += datum.weight();
  }
  defInfo = ContingencyTables.entropy(classDstr[0]);   
      }
      else{
  for(int i=0; i < growData.numInstances(); i++){
View Full Code Here

  defInfo = ContingencyTables.entropy(classDstr[0]);   
      }
      else{
  for(int i=0; i < growData.numInstances(); i++){
    Instance datum = growData.instance(i);
    classDstr[0][0] += datum.weight() * datum.classValue();
  }
   
  // No need to be divided by the denomitor because
  // it's always the same
  double defMean = (classDstr[0][0] / whole);
View Full Code Here

  growData = coverData;// Grow data size is shrinking      
   
  for(int x=0; x < uncoverData.numInstances(); x++){
    Instance datum = uncoverData.instance(x);
    if(m_ClassAttribute.isNumeric()){
      uncoveredWtSq += datum.weight() * datum.classValue() * datum.classValue();
      uncoveredWtVl += datum.weight() * datum.classValue();
      uncoveredWts += datum.weight();
      classDstr[0][0] -= datum.weight() * datum.classValue();
      classDstr[1][0] += datum.weight() * datum.classValue();
    }
View Full Code Here

   
  for(int x=0; x < uncoverData.numInstances(); x++){
    Instance datum = uncoverData.instance(x);
    if(m_ClassAttribute.isNumeric()){
      uncoveredWtSq += datum.weight() * datum.classValue() * datum.classValue();
      uncoveredWtVl += datum.weight() * datum.classValue();
      uncoveredWts += datum.weight();
      classDstr[0][0] -= datum.weight() * datum.classValue();
      classDstr[1][0] += datum.weight() * datum.classValue();
    }
    else{
View Full Code Here

  for(int x=0; x < uncoverData.numInstances(); x++){
    Instance datum = uncoverData.instance(x);
    if(m_ClassAttribute.isNumeric()){
      uncoveredWtSq += datum.weight() * datum.classValue() * datum.classValue();
      uncoveredWtVl += datum.weight() * datum.classValue();
      uncoveredWts += datum.weight();
      classDstr[0][0] -= datum.weight() * datum.classValue();
      classDstr[1][0] += datum.weight() * datum.classValue();
    }
    else{
      classDstr[0][(int)datum.classValue()] -= datum.weight();
View Full Code Here

    Instance datum = uncoverData.instance(x);
    if(m_ClassAttribute.isNumeric()){
      uncoveredWtSq += datum.weight() * datum.classValue() * datum.classValue();
      uncoveredWtVl += datum.weight() * datum.classValue();
      uncoveredWts += datum.weight();
      classDstr[0][0] -= datum.weight() * datum.classValue();
      classDstr[1][0] += datum.weight() * datum.classValue();
    }
    else{
      classDstr[0][(int)datum.classValue()] -= datum.weight();
      classDstr[1][(int)datum.classValue()] += datum.weight();
View Full Code Here

    if(m_ClassAttribute.isNumeric()){
      uncoveredWtSq += datum.weight() * datum.classValue() * datum.classValue();
      uncoveredWtVl += datum.weight() * datum.classValue();
      uncoveredWts += datum.weight();
      classDstr[0][0] -= datum.weight() * datum.classValue();
      classDstr[1][0] += datum.weight() * datum.classValue();
    }
    else{
      classDstr[0][(int)datum.classValue()] -= datum.weight();
      classDstr[1][(int)datum.classValue()] += datum.weight();
    }
View Full Code Here

      uncoveredWts += datum.weight();
      classDstr[0][0] -= datum.weight() * datum.classValue();
      classDstr[1][0] += datum.weight() * datum.classValue();
    }
    else{
      classDstr[0][(int)datum.classValue()] -= datum.weight();
      classDstr[1][(int)datum.classValue()] += datum.weight();
    }
  }        
   
  // Store class distribution of growing data
View Full Code Here

      classDstr[0][0] -= datum.weight() * datum.classValue();
      classDstr[1][0] += datum.weight() * datum.classValue();
    }
    else{
      classDstr[0][(int)datum.classValue()] -= datum.weight();
      classDstr[1][(int)datum.classValue()] += datum.weight();
    }
  }        
   
  // Store class distribution of growing data
  tmp = new double[2][m_NumClasses];
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.