Package weka.core

Examples of weka.core.Instance.classValue()


    m_intervalBounds[j][((int)inst.classValue()*2+1)]) {
        m_intervalBounds[j][((int)inst.classValue()*2+1)] =
    inst.value(j);
      }
      if (inst.value(j) >
    m_intervalBounds[j][((int)inst.classValue()*2+2)]) {
        m_intervalBounds[j][((int)inst.classValue()*2+2)] =
    inst.value(j);
      }
    }
  }
View Full Code Here


        m_intervalBounds[j][((int)inst.classValue()*2+1)] =
    inst.value(j);
      }
      if (inst.value(j) >
    m_intervalBounds[j][((int)inst.classValue()*2+2)]) {
        m_intervalBounds[j][((int)inst.classValue()*2+2)] =
    inst.value(j);
      }
    }
  }
      }
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 (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()] +=
      (inst.weight() / 2.0);;
    break;
        }
View Full Code Here

    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

        }
      }
    
    } else {
      // nominal attribute
      m_counts[j][(int)inst.value(j)][(int)inst.classValue()] +=
        inst.weight();;
    }
  }
      }
    }
View Full Code Here

      m_ErrorEstimator = null;

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

    } else {
View Full Code Here

                [numClasses] += inst.weight();
              counts[inst.index(i)][0][numClasses] -= inst.weight();
            }
          } else {
            counts[inst.index(i)][(int)inst.valueSparse(i)]
              [(int)inst.classValue()] += inst.weight();
            counts[inst.index(i)][0][(int)inst.classValue()] -= inst.weight();
          }
        }
      }
    }
View Full Code Here

              counts[inst.index(i)][0][numClasses] -= inst.weight();
            }
          } else {
            counts[inst.index(i)][(int)inst.valueSparse(i)]
              [(int)inst.classValue()] += inst.weight();
            counts[inst.index(i)][0][(int)inst.classValue()] -= inst.weight();
          }
        }
      }
    }
View Full Code Here

      System.out.println("Extracting data...");
    }

    for(int h=0; h<m_Data.length; h++){
      Instance current = train.instance(h);
      m_Classes[h] = (int)current.classValue()// Class value starts from 0
      Instances currInsts = current.relationalValue(1);
      int nI = currInsts.numInstances();
      totIns += (double)nI;

      for (int i = 0; i < nR; i++) {     
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.