Package weka.core

Examples of weka.core.Instance.weight()


      Instance instance = (Instance) enu.nextElement();
      if (!instance.classIsMissing()) {
  if (instances.classAttribute().isNominal()) {
    m_Counts[(int)instance.classValue()] += instance.weight();
  } else {
    m_ClassValue += instance.weight() * instance.classValue();
  }
  sumOfWeights += instance.weight();
      }
    }
    if (instances.classAttribute().isNumeric()) {
View Full Code Here


  if (instances.classAttribute().isNominal()) {
    m_Counts[(int)instance.classValue()] += instance.weight();
  } else {
    m_ClassValue += instance.weight() * instance.classValue();
  }
  sumOfWeights += instance.weight();
      }
    }
    if (instances.classAttribute().isNumeric()) {
      if (Utils.gr(sumOfWeights, 0)) {
  m_ClassValue /= sumOfWeights;
View Full Code Here

  if(inst.isMissing(att)){
    total = x;
    break;
  }
   
  sndCover += inst.weight();
  if(Utils.eq(inst.classValue(), cl))
    sndAccu += inst.weight();   
      }     

      if(total == 0) return null; // Data all missing for the attribute
View Full Code Here

    break;
  }
   
  sndCover += inst.weight();
  if(Utils.eq(inst.classValue(), cl))
    sndAccu += inst.weight();   
      }     

      if(total == 0) return null; // Data all missing for the attribute
      splitPoint = data.instance(total-1).value(att)
     
View Full Code Here

     (data.instance(split).value(att) > // Can't split within
      data.instance(prev).value(att))){ // same value     
       
    for(int y=prev; y<split; y++){
      Instance inst = data.instance(y);
      fstCover += inst.weight();
      if(Utils.eq(data.instance(y).classValue(), cl)){
        fstAccu += inst.weight()// First bag positive# ++
      }             
    }
       
View Full Code Here

       
    for(int y=prev; y<split; y++){
      Instance inst = data.instance(y);
      fstCover += inst.weight();
      if(Utils.eq(data.instance(y).classValue(), cl)){
        fstAccu += inst.weight()// First bag positive# ++
      }             
    }
       
    double fstAccuRate = (fstAccu+1.0)/(fstCover+1.0),
      sndAccuRate = (sndAccu+1.0)/(sndCover+1.0);
View Full Code Here

      finalSplit = (isFirst) ? split : prev;
    }
       
    for(int y=prev; y<split; y++){
      Instance inst = data.instance(y);
      sndCover -= inst.weight();
      if(Utils.eq(data.instance(y).classValue(), cl)){
        sndAccu -= inst.weight()// Second bag positive# --
      }             
    }       
    prev=split;
View Full Code Here

       
    for(int y=prev; y<split; y++){
      Instance inst = data.instance(y);
      sndCover -= inst.weight();
      if(Utils.eq(data.instance(y).classValue(), cl)){
        sndAccu -= inst.weight()// Second bag positive# --
      }             
    }       
    prev=split;
  }
      }
View Full Code Here

      for(int x=0; x<data.numInstances(); x++){
  Instance inst=data.instance(x);
  if(!inst.isMissing(att)){
    int v = (int)inst.value(att);
    splitData[v].add(inst);
    coverage[v] += inst.weight();
    if((int)inst.classValue() == (int)cl)
      accurate[v] += inst.weight();
  }
      }
     
View Full Code Here

  if(!inst.isMissing(att)){
    int v = (int)inst.value(att);
    splitData[v].add(inst);
    coverage[v] += inst.weight();
    if((int)inst.classValue() == (int)cl)
      accurate[v] += inst.weight();
  }
      }
     
      for(int x=0; x<bag; x++){
  double t = coverage[x]+1.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.