Package weka.core

Examples of weka.core.Instances.compactify()


   
    Instances primeInsts = new Instances(insts, 0, numPrime);
/*    for (int i = 0; i < numPrime; i++) {
      primeInsts.add(insts.instance(i));
    } */
    primeInsts.compactify();
    if (forecaster instanceof TSLagUser && artificialTimeStartValue >= 0) {
      ((TSLagUser)forecaster).getTSLagMaker().
        setArtificialTimeStartValue(artificialTimeStartValue - 1 + numPrime);
    }   
   
View Full Code Here


    data.add(subsets[i].instance(k));
  }
  for (int k = 0; k < subsets[j].numInstances(); k++) {
    data.add(subsets[j].instance(k));
  }
  data.compactify();
  data.randomize(rand);
  m_classifiers[i][j].buildClassifier(data, i, j,
              m_fitLogisticModels,
              m_numFolds, m_randomSeed);
      }
View Full Code Here

          data.add(subsets[i].instance(k));
        }
        for (int k = 0; k < subsets[j].numInstances(); k++) {
          data.add(subsets[j].instance(k));
       
        data.compactify();
        data.randomize(rand);
        m_classifiers[i][j].buildClassifier(data, i, j,
            m_fitLogisticModels,
            m_numFolds, m_randomSeed);
      }
View Full Code Here

  Instance i = (Instance) enu.nextElement();
  if (resultRule(i) != -1) {
    r.add(i);
  }
      }
      r.compactify();
      return r;
    }

    /**
     * Returns the set of instances that are not covered by this rule.
View Full Code Here

  Instance i = (Instance) enu.nextElement();
  if (resultRule(i) == -1) {
    r.add(i);
  }
      }
      r.compactify();
      return r;
    }

    /**
     * Prints the set of rules.
View Full Code Here

        if (passesMustContain(data.instance(i),
            transactionsMustContainIndexes, numInTransactionsMustContainList)) {
          newInsts.add(data.instance(i));
        }
      }
      newInsts.compactify();
      return newInsts;
    }
  }
 
  private ArrayList<Attribute> parseRulesMustContain(Instances data) {
View Full Code Here

      // create the new Instances
      Instances dataSet = new Instances(m_structure, m_batch.size());
      for (Instance i : m_batch) {
        dataSet.add(i);
      }
      dataSet.compactify();
     
      // save memory
      m_batch = null;
     
      if (m_log != null) {
View Full Code Here

      }
      // free memory
      subsets[i] = null;
    }
    train.compactify();
    test.compactify();
   
    // randomize the final sets
    train.randomize(rand);
    test.randomize(rand);
  } else {
View Full Code Here

  Instance i = (Instance) enu.nextElement();
  if (resultRule(i) != -1) {
    r.add(i);
  }
      }
      r.compactify();
      return r;
    }

    /**
     * Returns the set of instances that are not covered by this rule.
View Full Code Here

  Instance i = (Instance) enu.nextElement();
  if (resultRule(i) == -1) {
    r.add(i);
  }
      }
      r.compactify();
      return r;
    }

    /**
     * Prints the set of rules.
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.