Package weka.core

Examples of weka.core.Instance.classValue()


   
  sndCover += inst.weight();
  if(m_ClassAttribute.isNominal()) // Nominal class
    snd[(int)inst.classValue()] += inst.weight();   
  else{                            // Numeric class
    sndWtSq += inst.weight() * inst.classValue() * inst.classValue();
    sndWtVl += inst.weight() * inst.classValue();
  }
      }
     
     
View Full Code Here


  sndCover += inst.weight();
  if(m_ClassAttribute.isNominal()) // Nominal class
    snd[(int)inst.classValue()] += inst.weight();   
  else{                            // Numeric class
    sndWtSq += inst.weight() * inst.classValue() * inst.classValue();
    sndWtVl += inst.weight() * inst.classValue();
  }
      }
     
     
      // Enough Instances with known values?
View Full Code Here

      Instances missingData = new Instances(data, 0);
      for(int y=total; y < data.numInstances(); y++){     
  Instance inst = data.instance(y);
  missingData.add(inst);
  if(m_ClassAttribute.isNominal())
    missing[(int)inst.classValue()] += inst.weight();
  else{
    msingWtSq += inst.weight() * inst.classValue() * inst.classValue();
    msingWtVl += inst.weight() * inst.classValue();
  }     
      }     
View Full Code Here

  Instance inst = data.instance(y);
  missingData.add(inst);
  if(m_ClassAttribute.isNominal())
    missing[(int)inst.classValue()] += inst.weight();
  else{
    msingWtSq += inst.weight() * inst.classValue() * inst.classValue();
    msingWtVl += inst.weight() * inst.classValue();
  }     
      }     
     
      if(total == 0) return null; // Data all missing for the attribute  
View Full Code Here

  Instance inst = data.instance(y);
  missingData.add(inst);
  if(m_ClassAttribute.isNominal())
    missing[(int)inst.classValue()] += inst.weight();
  else{
    msingWtSq += inst.weight() * inst.classValue() * inst.classValue();
    msingWtVl += inst.weight() * inst.classValue();
  }     
      }     
     
      if(total == 0) return null; // Data all missing for the attribute  
View Full Code Here

  missingData.add(inst);
  if(m_ClassAttribute.isNominal())
    missing[(int)inst.classValue()] += inst.weight();
  else{
    msingWtSq += inst.weight() * inst.classValue() * inst.classValue();
    msingWtVl += inst.weight() * inst.classValue();
  }     
      }     
     
      if(total == 0) return null; // Data all missing for the attribute  
     
View Full Code Here

    // Move the split point
    for(int y=prev; y<split; y++){
      Instance inst = data.instance(y);
      fstCover += inst.weight(); sndCover -= inst.weight();
      if(m_ClassAttribute.isNominal()){ // Nominal class
        fst[(int)inst.classValue()] += inst.weight();
        snd[(int)inst.classValue()] -= inst.weight();
      }  
      else{                             // Numeric class
        fstWtSq += inst.weight() * inst.classValue() * inst.classValue();
        fstWtVl += inst.weight() * inst.classValue();
 
View Full Code Here

    for(int y=prev; y<split; y++){
      Instance inst = data.instance(y);
      fstCover += inst.weight(); sndCover -= inst.weight();
      if(m_ClassAttribute.isNominal()){ // Nominal class
        fst[(int)inst.classValue()] += inst.weight();
        snd[(int)inst.classValue()] -= inst.weight();
      }  
      else{                             // Numeric class
        fstWtSq += inst.weight() * inst.classValue() * inst.classValue();
        fstWtVl += inst.weight() * inst.classValue();
        sndWtSq -= inst.weight() * inst.classValue() * inst.classValue();
 
View Full Code Here

      if(m_ClassAttribute.isNominal()){ // Nominal class
        fst[(int)inst.classValue()] += inst.weight();
        snd[(int)inst.classValue()] -= inst.weight();
      }  
      else{                             // Numeric class
        fstWtSq += inst.weight() * inst.classValue() * inst.classValue();
        fstWtVl += inst.weight() * inst.classValue();
        sndWtSq -= inst.weight() * inst.classValue() * inst.classValue();
        sndWtVl -= inst.weight() * inst.classValue();
      }
    }
View Full Code Here

      if(m_ClassAttribute.isNominal()){ // Nominal class
        fst[(int)inst.classValue()] += inst.weight();
        snd[(int)inst.classValue()] -= inst.weight();
      }  
      else{                             // Numeric class
        fstWtSq += inst.weight() * inst.classValue() * inst.classValue();
        fstWtVl += inst.weight() * inst.classValue();
        sndWtSq -= inst.weight() * inst.classValue() * inst.classValue();
        sndWtVl -= inst.weight() * inst.classValue();
      }
    }
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.