Examples of stratify()


Examples of weka.core.Instances.stratify()

    // Randomize on a copy of the original dataset
    Instances runInstances = new Instances(m_Instances);
    Random random = new Random(run);
    runInstances.randomize(random);
    if (runInstances.classAttribute().isNominal()) {
      runInstances.stratify(m_NumFolds);
    }

    // Add in some fields to the key like run and fold number, dataset name
    Object [] seKey = m_SplitEvaluator.getKey();
    Object [] key = new Object [seKey.length + 3];
View Full Code Here

Examples of weka.core.Instances.stratify()

        m_Log.statusMessage("Randomizing instances...");
        Random random = new Random(seed);
        inst.randomize(random);
        if (inst.attribute(classIndex).isNominal()) {
    m_Log.statusMessage("Stratifying instances...");
    inst.stratify(numFolds);
        }
        for (int fold = 0; fold < numFolds;fold++) {
    m_Log.statusMessage("Creating splits for fold "
            + (fold + 1) + "...");
    Instances train = inst.trainCV(numFolds, fold, random);
View Full Code Here

Examples of weka.core.Instances.stratify()

  //Best iteration is selected only from these.
  int completedIterations = m_maxIterations;
 
  Instances allData = new Instances(m_train);
 
  allData.stratify(m_numFoldsBoosting);       

  double[] error = new double[m_maxIterations + 1]
 
  for (int i = 0; i < m_numFoldsBoosting; i++) {
      //split into training/test data in fold
View Full Code Here

Examples of weka.core.Instances.stratify()

          dataSet.randomize(random);
        }
        if (dataSet.classIndex() >= 0 &&
      dataSet.attribute(dataSet.classIndex()).isNominal() &&
      !m_preserveOrder) {
    dataSet.stratify(getFolds());
    if (m_logger != null) {
      m_logger.logMessage("[" + getCustomName() + "] "
              +"stratifying data");
    }
        }
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.