Examples of randomize()


Examples of weka.core.Instances.randomize()

        break;

        case 2: // Percent split
        m_Log.statusMessage(Messages.getInstance().getString("ClustererPanel_StartClusterer_Run_Log_StatusMessage_Fourth"));
        inst.randomize(new Random(1));
        trainInst.randomize(new Random(1));
        int trainSize = trainInst.numInstances() * percent / 100;
        int testSize = trainInst.numInstances() - trainSize;
        Instances train = new Instances(trainInst, 0, trainSize);
        Instances test = new Instances(trainInst, trainSize, testSize);
        Instances testVis = new Instances(inst, trainSize, testSize);
View Full Code Here

Examples of weka.core.Instances.randomize()

        break;

        case 1: // CV mode
        m_Log.statusMessage(Messages.getInstance().getString("AttributeSelectionPanel_StartAttributeSelection_Run_Log_StatusMessage_Text_Second"));
        Random random = new Random(seed);
        inst.randomize(random);
        if (inst.attribute(classIndex).isNominal()) {
    m_Log.statusMessage(Messages.getInstance().getString("AttributeSelectionPanel_StartAttributeSelection_Run_Log_StatusMessage_Text_Third"));
    inst.stratify(numFolds);
        }
        for (int fold = 0; fold < numFolds;fold++) {
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()

    train.compactify();
    test.compactify();
   
    // randomize the final sets
    train.randomize(rand);
    test.randomize(rand);
  } else {
   
    // Numeric target
    int trainSize =
      Utils.probRound(runInstances.numInstances() * m_TrainPercent / 100, rand);
View Full Code Here

Examples of weka.core.Instances.randomize()

    Instances[] testData = new Instances[m_numFolds];
    LFSMethods[] searchResults = new LFSMethods[m_numFolds];

    Random random = new Random(m_seed);
    Instances dataCopy = new Instances(data);
    dataCopy.randomize(random);

    if (dataCopy.classAttribute().isNominal()) {
      dataCopy.stratify(m_numFolds);
    }
View Full Code Here

Examples of weka.core.Instances.randomize()

    double minC=0, maxC=0;

    /** Resampling  **/
    if(Double.parseDouble(m_resamplePercent.getText())<100) {
        inst = new Instances(m_data, 0, m_data.numInstances());
        inst.randomize( new Random(Integer.parseInt(m_rseed.getText())) );
       
        //System.err.println("gettingPercent: " +
        //                   Math.round(
        //                     Double.parseDouble(m_resamplePercent.getText())
        //                     / 100D * m_data.numInstances()
 
View Full Code Here

Examples of weka.core.Instances.randomize()

      return;
    }

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

    double[][] alphas = new double[m_numFoldsPruning][];
    double[][] errors = new double[m_numFoldsPruning][];
View Full Code Here

Examples of weka.core.Instances.randomize()

      m_foldThread = new Thread() {
    public void run() {
      boolean errorOccurred = false;
      try {
        Random random = new Random(getSeed());
        dataSet.randomize(random);
        if (dataSet.classIndex() >= 0 &&
      dataSet.attribute(dataSet.classIndex()).isNominal()) {
    dataSet.stratify(getFolds());
    if (m_logger != null) {
      m_logger.logMessage(Messages.getInstance().getString("CrossValidationFoldMaker_AcceptDataSet_LogMessage_Text_First") + getCustomName() + Messages.getInstance().getString("CrossValidationFoldMaker_AcceptDataSet_LogMessage_Text_Second"));
View Full Code Here

Examples of weka.core.Instances.randomize()

    // remove instances with missing class
    Instances newData = new Instances(data);
    newData.deleteWithMissingClass();
   
    Random random = new Random(m_Seed);
    newData.randomize(random);
    if (newData.classAttribute().isNominal() && (m_NumXValFolds > 1)) {
      newData.stratify(m_NumXValFolds);
    }
    Instances train = newData;               // train on all data by default
    Instances test = newData;               // test on training data by default
View Full Code Here

Examples of weka.core.Instances.randomize()

    train.compactify();
    test.compactify();
   
    // randomize the final sets
    train.randomize(rand);
    test.randomize(rand);
  } else {
   
    // Numeric target
    int trainSize =
      Utils.probRound(runInstances.numInstances() * m_TrainPercent / 100, rand);
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.