Package weka.core

Examples of weka.core.FastVector.elementAt()


      // Need to compute average document length if necessary
      if (m_filterType != FILTER_NONE) {
  m_AvgDocLength = 0;
  for(int i=0; i<fv.size(); i++) {
    Instance inst = (Instance) fv.elementAt(i);
    double docLength = 0;
    for(int j=0; j<inst.numValues(); j++) {
      if(inst.index(j)>=firstCopy) {
        docLength += inst.valueSparse(j) * inst.valueSparse(j);
      }
View Full Code Here


      }

      // Perform normalization if necessary.
      if (m_filterType == FILTER_NORMALIZE_ALL) {
  for(int i=0; i<fv.size(); i++) {
    normalizeInstance((Instance) fv.elementAt(i), firstCopy);
  }
      }

      // Push all instances into the output queue
      for(int i=0; i<fv.size(); i++) {
View Full Code Here

  }
      }

      // Push all instances into the output queue
      for(int i=0; i<fv.size(); i++) {
  push((Instance) fv.elementAt(i));
      }
    }

    // Flush the input
    flushInput();
View Full Code Here

      n3 = r.nextInt(nC-1);
    } while (n3 == n1 || n3 == n2 || m_Classes[n3] == 0);
    index.addElement(new Integer(n3));

    for (int s = 0; s < index.size(); s++){
      int exIdx = ((Integer)index.elementAt(s)).intValue();
      if (m_Debug)
        System.out.println("\nH0 at "+exIdx);


      for (int p = 0; p < m_Data[exIdx][0].length; p++) {
View Full Code Here

    }

    // a zero element array indicates maximum constraint
    String [] columnNames = new String [numColumns];
    for (int i=0;i<numColumns;i++) {
      columnNames[i] = (String)(cNames.elementAt(i));
    }

    return columnNames;
  }
View Full Code Here

   
    PairedStats pairedStats = new PairedStats(m_SignificanceLevel);

    for (int k = 0; k < dataset1.size(); k ++) {
      Instance current1 = (Instance) dataset1.elementAt(k);
      Instance current2 = (Instance) dataset2.elementAt(k);
      if (current1.isMissing(comparisonColumn)) {
  System.err.println("Instance has missing value in comparison "
         + "column!\n" + current1);
  continue;
      }
View Full Code Here

      if (m_shapes != null) {
  FastVector stmp;
  double x1, y1, x2, y2;
  for (int noa = 0; noa < m_shapes.size(); noa++) {
    stmp = (FastVector)m_shapes.elementAt(noa);
    if (((Double)stmp.elementAt(0)).intValue() == 1) {
      //then rectangle
      x1 = ((Double)stmp.elementAt(1)).doubleValue();
      y1 = ((Double)stmp.elementAt(2)).doubleValue();
      x2 = ((Double)stmp.elementAt(3)).doubleValue();
      y2 = ((Double)stmp.elementAt(4)).doubleValue();
View Full Code Here

  double x1, y1, x2, y2;
  for (int noa = 0; noa < m_shapes.size(); noa++) {
    stmp = (FastVector)m_shapes.elementAt(noa);
    if (((Double)stmp.elementAt(0)).intValue() == 1) {
      //then rectangle
      x1 = ((Double)stmp.elementAt(1)).doubleValue();
      y1 = ((Double)stmp.elementAt(2)).doubleValue();
      x2 = ((Double)stmp.elementAt(3)).doubleValue();
      y2 = ((Double)stmp.elementAt(4)).doubleValue();
      if (i.value(m_xIndex) >= x1 && i.value(m_xIndex) <= x2 &&
    i.value(m_yIndex) <= y1 && i.value(m_yIndex) >= y2) {
View Full Code Here

  for (int noa = 0; noa < m_shapes.size(); noa++) {
    stmp = (FastVector)m_shapes.elementAt(noa);
    if (((Double)stmp.elementAt(0)).intValue() == 1) {
      //then rectangle
      x1 = ((Double)stmp.elementAt(1)).doubleValue();
      y1 = ((Double)stmp.elementAt(2)).doubleValue();
      x2 = ((Double)stmp.elementAt(3)).doubleValue();
      y2 = ((Double)stmp.elementAt(4)).doubleValue();
      if (i.value(m_xIndex) >= x1 && i.value(m_xIndex) <= x2 &&
    i.value(m_yIndex) <= y1 && i.value(m_yIndex) >= y2) {
        //then is inside split so return true;
View Full Code Here

    stmp = (FastVector)m_shapes.elementAt(noa);
    if (((Double)stmp.elementAt(0)).intValue() == 1) {
      //then rectangle
      x1 = ((Double)stmp.elementAt(1)).doubleValue();
      y1 = ((Double)stmp.elementAt(2)).doubleValue();
      x2 = ((Double)stmp.elementAt(3)).doubleValue();
      y2 = ((Double)stmp.elementAt(4)).doubleValue();
      if (i.value(m_xIndex) >= x1 && i.value(m_xIndex) <= x2 &&
    i.value(m_yIndex) <= y1 && i.value(m_yIndex) >= y2) {
        //then is inside split so return true;
        return true;
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.