Examples of stratify()


Examples of etc.aloe.processes.CrossValidationPrep.stratify()

        List<TestLabelable> items = new ArrayList<TestLabelable>(originalItems);

        int numStrats = 3;
        CrossValidationPrep instance = new CrossValidationPrep();
        List<TestLabelable> stratified = instance.stratify(items, numStrats);

        assertEquals("size unchanged", originalItems.size(), stratified.size());

        int stratSize = originalItems.size() / numStrats;
        for (int i = stratSize; i < originalItems.size(); i++) {
View Full Code Here

Examples of weka.core.Instances.stratify()

       m_BestClassifierOptions = m_InitOptions;
       return;
    }

    if (trainData.classAttribute().isNominal()) {
      trainData.stratify(m_NumFolds);
    }
    m_BestClassifierOptions = null;
   
    // Set up m_ClassifierOptions -- take getOptions() and remove
    // those being optimised.
View Full Code Here

Examples of weka.core.Instances.stratify()

    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);
      Instances pruneData=data.testCV(m_Folds, m_Folds-1);

      grow(growData);      // Build this rule 
View Full Code Here

Examples of weka.core.Instances.stratify()

    newData.deleteWithMissingClass();

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

    // Create meta level
    generateMetaLevel(newData, random);
View Full Code Here

Examples of weka.core.Instances.stratify()

        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++) {
    m_Log.statusMessage(Messages.getInstance().getString("AttributeSelectionPanel_StartAttributeSelection_Run_Log_StatusMessage_Text_Fourth")
            + (fold + 1) + Messages.getInstance().getString("AttributeSelectionPanel_StartAttributeSelection_Run_Log_StatusMessage_Text_Fifth"));
    Instances train = inst.trainCV(numFolds, fold, random);
View Full Code Here

Examples of weka.core.Instances.stratify()

    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];
    FastVector[] parallelBFElements = new FastVector [m_numFoldsPruning];
    BFTree[] m_roots = new BFTree[m_numFoldsPruning];
View Full Code Here

Examples of weka.core.Instances.stratify()

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

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

    if (dataCopy.classAttribute().isNominal()) {
      dataCopy.stratify(m_numFolds);
    }

    for (int f = 0; f < m_numFolds; f++) {
      trainData[f] = dataCopy.trainCV(m_numFolds, f, random);
      testData[f] = dataCopy.testCV(m_numFolds, f);
View Full Code Here

Examples of weka.core.Instances.stratify()

    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][];

    // calculate errors and alphas for each fold
View Full Code Here

Examples of weka.core.Instances.stratify()

      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
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.