Examples of randomize()


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()

  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()

     
      m_Antds = new FastVector()
     
      /* Split data into Grow and Prune*/
      m_Random = new Random(m_Seed);
      data.randomize(m_Random);
      data.stratify(m_Folds);
      Instances growData=data.trainCV(m_Folds, m_Folds-1, m_Random);
      Instances pruneData=data.testCV(m_Folds, m_Folds-1);
     
      grow(growData);      // Build this rule
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_splitThread == null) {
      final Instances dataSet = new Instances(e.getDataSet());
      m_splitThread = new Thread() {
    public void run() {
      try {
        dataSet.randomize(new Random(m_randomSeed));
        int trainSize =
                (int)Math.round(dataSet.numInstances() * m_trainPercentage / 100);
        int testSize = dataSet.numInstances() - trainSize;
     
        Instances train = new Instances(dataSet, 0, trainSize);
View Full Code Here

Examples of weka.core.Instances.randomize()

    throws Exception {

    FastVector predictions = new FastVector();
    Instances runInstances = new Instances(data);
    Random random = new Random(m_Seed);
    runInstances.randomize(random);
    if (runInstances.classAttribute().isNominal() && (numFolds > 1)) {
      runInstances.stratify(numFolds);
    }
    int inst = 0;
    for (int fold = 0; fold < numFolds; fold++) {
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);
    Random random = new Random(run);
    runInstances.randomize(random);
    if (runInstances.classAttribute().isNominal()) {
      runInstances.stratify(m_NumFolds);
    }
    for (int fold = 0; fold < m_NumFolds; fold++) {
      // Add in some fields to the key like run and fold number, dataset name
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.