Examples of randomize()


Examples of weka.core.Instances.randomize()

      // theInstances.stratify(10);
       
      CVincreased = false;
      cvr = new Random(getSeed());
      trainCopy = new Instances(m_theInstances);
      trainCopy.randomize(cvr);
      templl = 0.0;
      for (i = 0; i < numFolds; i++) {
  Instances cvTrain = trainCopy.trainCV(numFolds, i, cvr);
  if (num_clusters > cvTrain.numInstances()) {
    break CLUSTER_SEARCH;
View Full Code Here

Examples of weka.core.Instances.randomize()

            newInstance.setClassValue( instance.classValue( ) );
            dataSubSet.add( newInstance );
          }
        }

        dataSubSet.randomize(random);
        // Remove a percentage of the instances
  Instances originalDataSubSet = dataSubSet;
  dataSubSet.randomize(random);
        RemovePercentage rp = new RemovePercentage();
        rp.setPercentage( m_RemovedPercentage );
View Full Code Here

Examples of weka.core.Instances.randomize()

        }
        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

Examples of weka.core.Instances.randomize()

  // create new train/test sources
  if (splitPercentage > 0) {
    testSetPresent = true;
    Instances tmpInst = trainSource.getDataSet(actualClassIndex);
    if (!preserveOrder)
      tmpInst.randomize(new Random(seed));
    int trainSize =
            (int) Math.round(tmpInst.numInstances() * splitPercentage / 100);
    int testSize  = tmpInst.numInstances() - trainSize;
    Instances trainInst = new Instances(tmpInst, 0, trainSize);
    Instances testInst  = new Instances(tmpInst, trainSize, testSize);
View Full Code Here

Examples of weka.core.Instances.randomize()

  inBag[j] = new boolean[data.numInstances()];
  bagData = resampleWithWeights(data, random, inBag[j]);
      } else {
  bagData = data.resampleWithWeights(random);
  if (bagSize < data.numInstances()) {
    bagData.randomize(random);
    Instances newBagData = new Instances(bagData, 0, bagSize);
    bagData = newBagData;
  }
      }
     
View Full Code Here

Examples of weka.core.Instances.randomize()

    if(m_NumAntds != -1){
      grow(data);
    }
    else{

      data.randomize(m_Random);

      // Split data into Grow and Prune    
      data.stratify(m_Folds);
 
      Instances growData=data.trainCV(m_Folds, m_Folds-1, m_Random);
View Full Code Here

Examples of weka.core.Instances.randomize()

    Instances newData = new Instances(data);
    m_BaseFormat = new Instances(data, 0);
    newData.deleteWithMissingClass();

    Random random = new Random(m_Seed);
    newData.randomize(random);
    if (newData.classAttribute().isNominal()) {
      newData.stratify(m_NumFolds);
    }

    // Create meta level
View Full Code Here

Examples of weka.core.Instances.randomize()

      throw new Exception("No Instances set");
    }

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

    // Tell the resultproducer to send results to us
View Full Code Here

Examples of weka.core.Instances.randomize()

  RidorRule rule = new RidorRule();                               
  rule.setPredictedClass(0);       // Predict the classes other than default
   
  for(int j = 0; j < m_Shuffle; j++){
    if(m_Shuffle > 1)
      data.randomize(m_Random);
       
    rule.buildClassifier(data);
       
    double wr, w; // Worth rate and worth
    if(m_IsAllErr){
View Full Code Here

Examples of weka.core.Instances.randomize()

    // weights for root nodes of each fold for prepruning and postpruning.
    int expansion = 0;

    Random random = new Random(m_Seed);
    Instances cvData = new Instances(data);
    cvData.randomize(random);
    cvData = new Instances(cvData,0,(int)(cvData.numInstances()*m_SizePer)-1);
    cvData.stratify(m_numFoldsPruning);

    Instances[] train = new Instances[m_numFoldsPruning];
    Instances[] test = new Instances[m_numFoldsPruning];
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.