Package weka.core

Examples of weka.core.FastVector.elementAt()


      b[1][t] = Double.NaN;
    }

    // Largest positive exemplar
    for(int s=0; s<maxSzIdx.size(); s++){
      int exIdx = ((Integer)maxSzIdx.elementAt(s)).intValue();
      for(int p=0; p<m_Data[exIdx][0].length; p++){
        for (int q=0; q < nR;q++){
          x[2*q] = m_Data[exIdx][q][p]// pick one instance
          x[2*q+1] = 1.0;
        }   
View Full Code Here


      if (!m_UseOneSE) expansion = expansion - 1;
      else {
  double oneSE = Math.sqrt(minError*(1-minError)/data.numInstances());
  for (int i=0; i<errorList.size(); i++) {
    double error = ((Double)(errorList.elementAt(i))).doubleValue();
    if (error<=minError + oneSE) { // && counts[i]>=m_numFoldsPruning/2) {
      expansion = i;
      break;
    }
  }
View Full Code Here

    // All information about the node to split (the first BestFirst object in
    // BestFirstElements)
    FastVector firstElement = (FastVector)BestFirstElements.elementAt(0);

    // split attribute
    Attribute att = (Attribute)firstElement.elementAt(1);

    // info of split value or split string
    double splitValue = Double.NaN;
    String splitStr = null;
    if (att.isNumeric())
View Full Code Here

    // info of split value or split string
    double splitValue = Double.NaN;
    String splitStr = null;
    if (att.isNumeric())
      splitValue = ((Double)firstElement.elementAt(2)).doubleValue();
    else {
      splitStr=((String)firstElement.elementAt(2)).toString();
    }

    // the best gini gain or information gain of this node
View Full Code Here

    double splitValue = Double.NaN;
    String splitStr = null;
    if (att.isNumeric())
      splitValue = ((Double)firstElement.elementAt(2)).doubleValue();
    else {
      splitStr=((String)firstElement.elementAt(2)).toString();
    }

    // the best gini gain or information gain of this node
    double gain = ((Double)firstElement.elementAt(3)).doubleValue();
    ///////////////////////////////////////////////////////////////////////
View Full Code Here

    else {
      splitStr=((String)firstElement.elementAt(2)).toString();
    }

    // the best gini gain or information gain of this node
    double gain = ((Double)firstElement.elementAt(3)).doubleValue();
    ///////////////////////////////////////////////////////////////////////

    if (m_ClassProbs==null) {
      m_SortedIndices = new int[sortedIndices.length][0];
      m_Weights = new double[weights.length][0];
View Full Code Here

      BestFirstElements.removeElementAt(0);

      makeLeaf(data);
      if (BestFirstElements.size()!=0) {
  FastVector nextSplitElement = (FastVector)BestFirstElements.elementAt(0);
  BFTree nextSplitNode = (BFTree)nextSplitElement.elementAt(0);
  nextSplitNode.makeTree(BestFirstElements,data,
      nextSplitNode.m_SortedIndices, nextSplitNode.m_Weights,
      nextSplitNode.m_Dists,
      nextSplitNode.m_ClassProbs, nextSplitNode.m_TotalWeight,
      nextSplitNode.m_Props, minNumObj, useHeuristic, useGini, preExpansion);
View Full Code Here

    // because these nodes are sorted descendingly according to gini gain or information gain.
    // (namely, gini gain or information gain of all nodes in BestFirstEelements is 0).
    if (gain==0 || preExpansion==m_Expansion) {
      for (int i=0; i<BestFirstElements.size(); i++) {
  FastVector element = (FastVector)BestFirstElements.elementAt(i);
  BFTree node = (BFTree)element.elementAt(0);
  node.makeLeaf(data);
      }
      BestFirstElements.removeAllElements();
    }
View Full Code Here

      }

      // choose next node to split
      if (BestFirstElements.size()!=0) {
  FastVector nextSplitElement = (FastVector)BestFirstElements.elementAt(0);
  BFTree nextSplitNode = (BFTree)nextSplitElement.elementAt(0);
  nextSplitNode.makeTree(BestFirstElements,data,
      nextSplitNode.m_SortedIndices, nextSplitNode.m_Weights,
      nextSplitNode.m_Dists,
      nextSplitNode.m_ClassProbs, nextSplitNode.m_TotalWeight,
      nextSplitNode.m_Props, minNumObj, useHeuristic, useGini, preExpansion);
View Full Code Here

    // All information about the node to split (first BestFirst object in
    // BestFirstElements)
    FastVector firstElement = (FastVector)BestFirstElements.elementAt(0);

    // node to split
    BFTree nodeToSplit = (BFTree)firstElement.elementAt(0);

    // split attribute
    Attribute att = (Attribute)firstElement.elementAt(1);

    // info of split value or split string
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.