Examples of crossValidateModel()


Examples of weka.classifiers.Evaluation.crossValidateModel()

          AbstractClassifier aClassifier = classifiers[curCfr];

          Evaluation eval = new Evaluation(data);

          Long millis = System.currentTimeMillis();
          eval.crossValidateModel(aClassifier, data, numFolds, new Random(curRun));
          long elapsedTime = System.currentTimeMillis() - millis;

          double aucSum = 0.0;
          double sumClassProps = 0;
          for (int c = 0; c < data.numClasses(); c++) {
View Full Code Here

Examples of weka.classifiers.Evaluation.crossValidateModel()

            }
            eTest = new Evaluation(trainingSet);
            if (numFolds > trainingSet.numInstances()) {
                numFolds = trainingSet.numInstances();
            }
            eTest.crossValidateModel(cModel, trainingSet, numFolds, new Random(1));
        } catch (Exception ex) {
            Logger.getLogger(WekaWrapper.class.getName()).log(Level.SEVERE, null, ex);
            System.out.println(ex.toString());
        }
        return eTest;
View Full Code Here

Examples of weka.classifiers.Evaluation.crossValidateModel()

            if(mFoldsInput != null) {
              Integer folds = TupleUtilities.getNumber(readBlock(mFoldsInput), INPUT_FOLDS);
              Evaluation ev = new Evaluation(dataset);
              if(mSeedInput != null) {
                Integer seed = TupleUtilities.getNumber(readBlock(mSeedInput), INPUT_SEED);
                ev.crossValidateModel(classifier, dataset, folds, new Random(seed));
              }
              else
                ev.crossValidateModel(classifier, dataset, folds, new Random(123));
              if(mEvaluationOutput != null) {
                mEvaluationOutput.write(ev.toSummaryString());
View Full Code Here

Examples of weka.classifiers.Evaluation.crossValidateModel()

              if(mSeedInput != null) {
                Integer seed = TupleUtilities.getNumber(readBlock(mSeedInput), INPUT_SEED);
                ev.crossValidateModel(classifier, dataset, folds, new Random(seed));
              }
              else
                ev.crossValidateModel(classifier, dataset, folds, new Random(123));
              if(mEvaluationOutput != null) {
                mEvaluationOutput.write(ev.toSummaryString());
                LOG.debug("BuildClassifier evaluation: " + ev.toSummaryString());
              }
            }
View Full Code Here

Examples of weka.classifiers.Evaluation.crossValidateModel()

      o_Evaluation.evaluateModel(oneR, trainCopy);
    } else {
      /*      o_Evaluation.crossValidateModel("weka.classifiers.rules.OneR",
              trainCopy, 10,
              null, new Random(m_randomSeed)); */
      o_Evaluation.crossValidateModel(oneR, trainCopy, m_folds, new Random(m_randomSeed));
    }
    errorRate = o_Evaluation.errorRate();
    return  (1 - errorRate)*100.0;
  }

View Full Code Here

Examples of weka.classifiers.Evaluation.crossValidateModel()

    // setup classifier
    classifier = (Classifier) setup(getClassifier(), x, y);

    // evaluate
    eval = new Evaluation(data);
    eval.crossValidateModel(classifier, data, cv, new Random(getSeed()));
    performances.add(new Performance(values, eval));
   
    // add to cache
    m_Cache.add(cv, new Performance(values, eval));
  }
View Full Code Here

Examples of weka.classifiers.Evaluation.crossValidateModel()

      o_Evaluation.evaluateModel(oneR, trainCopy);
    } else {
      /*      o_Evaluation.crossValidateModel("weka.classifiers.rules.OneR",
              trainCopy, 10,
              null, new Random(m_randomSeed)); */
      o_Evaluation.crossValidateModel(oneR, trainCopy, m_folds, new Random(m_randomSeed));
    }
    errorRate = o_Evaluation.errorRate();
    return  (1 - errorRate)*100.0;
  }

View Full Code Here

Examples of weka.classifiers.Evaluation.crossValidateModel()

    // setup classifier
    classifier = (Classifier) setup(getClassifier(), x, y);

    // evaluate
    eval = new Evaluation(data);
    eval.crossValidateModel(classifier, data, cv, new Random(getSeed()));
    performances.add(new Performance(values, eval));
   
    // add to cache
    m_Cache.add(cv, new Performance(values, eval));
  }
View Full Code Here

Examples of weka.classifiers.Evaluation.crossValidateModel()

      o_Evaluation.evaluateModel(oneR, trainCopy);
    } else {
      /*      o_Evaluation.crossValidateModel("weka.classifiers.rules.OneR",
              trainCopy, 10,
              null, new Random(m_randomSeed)); */
      o_Evaluation.crossValidateModel(oneR, trainCopy, m_folds, new Random(m_randomSeed));
    }
    errorRate = o_Evaluation.errorRate();
    return  (1 - errorRate)*100.0;
  }

View Full Code Here

Examples of weka.classifiers.Evaluation.crossValidateModel()

            try {
                train.setClassIndex(1);
                Evaluation ev = new Evaluation(train);
                if (test == null) {
                    // use 5-fold cross-validation
                    ev.crossValidateModel(classifier, train, Math.min(train.numInstances(), 5), new Random(42));
                } else {
                    test.setClassIndex(1);
                    classifier.buildClassifier(train);
                    ev.evaluateModel(classifier, test);
                }
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.