Package weka.core

Examples of weka.core.TestInstances


                                      int numString, int numDate,
                                      int numRelational,
                                      boolean multiInstance)
  throws Exception {
   
    TestInstances dataset = new TestInstances();
   
    dataset.setSeed(seed);
    dataset.setNumInstances(numInstances);
    dataset.setNumNominal(numNominal);
    dataset.setNumNumeric(numNumeric);
    dataset.setNumString(numString);
    dataset.setNumDate(numDate);
    dataset.setNumRelational(numRelational);
    dataset.setClassIndex(TestInstances.NO_CLASS);
    dataset.setMultiInstance(multiInstance);
   
    return dataset.generate();
  }
View Full Code Here


                                      int numClasses, int classType,
                                      int classIndex,
                                      boolean multiInstance)
  throws Exception {
   
    TestInstances dataset = new TestInstances();
   
    dataset.setSeed(seed);
    dataset.setNumInstances(numInstances);
    dataset.setNumNominal(numNominal);
    dataset.setNumNumeric(numNumeric);
    dataset.setNumString(numString);
    dataset.setNumDate(numDate);
    dataset.setNumRelational(numRelational);
    dataset.setNumClasses(numClasses);
    dataset.setClassType(classType);
    dataset.setClassIndex(classIndex);
    dataset.setNumClasses(numClasses);
    dataset.setMultiInstance(multiInstance);
    dataset.setWords(getWords());
    dataset.setWordSeparators(getWordSeparators());
   
    return process(dataset.generate());
  }
View Full Code Here

                                      int numClasses, int classType,
                                      int classIndex,
                                      boolean multiInstance)
  throws Exception {
   
    TestInstances dataset = new TestInstances();
   
    dataset.setSeed(seed);
    dataset.setNumInstances(numInstances);
    dataset.setNumNominal(numNominal);
    dataset.setNumNumeric(numNumeric);
    dataset.setNumString(numString);
    dataset.setNumDate(numDate);
    dataset.setNumRelational(numRelational);
    dataset.setNumClasses(numClasses);
    dataset.setClassType(classType);
    dataset.setClassIndex(classIndex);
    dataset.setNumClasses(numClasses);
    dataset.setMultiInstance(multiInstance);
    dataset.setWords(getWords());
    dataset.setWordSeparators(getWordSeparators());
   
    return process(dataset.generate());
  }
View Full Code Here

                                      int numClasses, int classType,
                                      int classIndex,
                                      boolean multiInstance)
  throws Exception {
   
    TestInstances dataset = new TestInstances();
   
    dataset.setSeed(seed);
    dataset.setNumInstances(numInstances);
    dataset.setNumNominal(numNominal);
    dataset.setNumNumeric(numNumeric);
    dataset.setNumString(numString);
    dataset.setNumDate(numDate);
    dataset.setNumRelational(numRelational);
    dataset.setNumClasses(numClasses);
    if (classType == NO_CLASS) {
      dataset.setClassType(Attribute.NOMINAL)// ignored
      dataset.setClassIndex(TestInstances.NO_CLASS);
    }
    else {
      dataset.setClassType(classType);
      dataset.setClassIndex(classIndex);
    }
    dataset.setNumClasses(numClasses);
    dataset.setMultiInstance(multiInstance);
    dataset.setWords(getWords());
    dataset.setWordSeparators(getWordSeparators());
   
    return process(dataset.generate());
  }
View Full Code Here

                                      int numClasses, int classType,
                                      int classIndex,
                                      boolean multiInstance)
  throws Exception {
   
    TestInstances dataset = new TestInstances();
   
    dataset.setSeed(seed);
    dataset.setNumInstances(numInstances);
    dataset.setNumNominal(numNominal);
    dataset.setNumNumeric(numNumeric);
    dataset.setNumString(numString);
    dataset.setNumDate(numDate);
    dataset.setNumRelational(numRelational);
    dataset.setNumClasses(numClasses);
    dataset.setClassType(classType);
    dataset.setClassIndex(classIndex);
    dataset.setNumClasses(numClasses);
    dataset.setMultiInstance(multiInstance);
    dataset.setWords(getWords());
    dataset.setWordSeparators(getWordSeparators());
   
    return process(dataset.generate());
  }
View Full Code Here

              int numAttr, AttrTypes attrTypes,
              int numClasses, int classType,
              int classIndex)
    throws Exception {
   
    TestInstances dataset = new TestInstances();
   
    dataset.setSeed(seed);
    dataset.setNumInstances(numInstances);
    dataset.setNumNominal   (attrTypes.nominal     ? numAttr : 0);
    dataset.setNumNumeric   (attrTypes.numeric     ? numAttr : 0);
    dataset.setNumString    (attrTypes.string      ? numAttr : 0);
    dataset.setNumDate      (attrTypes.date        ? numAttr : 0);
    dataset.setNumRelational(attrTypes.relational  ? numAttr : 0);
    dataset.setNumClasses(numClasses);
    dataset.setClassType(classType);
    dataset.setClassIndex(classIndex);
   
    return process(dataset.generate());
  }
View Full Code Here

                                      int numClasses, int classType,
                                      int classIndex,
                                      boolean multiInstance)
  throws Exception {

    TestInstances dataset = new TestInstances();

    dataset.setSeed(seed);
    dataset.setNumInstances(numInstances);
    dataset.setNumNominal(numNominal);
    dataset.setNumNumeric(numNumeric);
    dataset.setNumString(numString);
    dataset.setNumDate(numDate);
    dataset.setNumRelational(numRelational);
    dataset.setNumClasses(numClasses);
    dataset.setClassType(classType);
    dataset.setClassIndex(classIndex);
    dataset.setNumClasses(numClasses);
    dataset.setMultiInstance(multiInstance);
    dataset.setWords(getWords());
    dataset.setWordSeparators(getWordSeparators());

    return process(dataset.generate());
  }
View Full Code Here

              int numAttr, AttrTypes attrTypes,
              int numClasses, int classType,
              int classIndex)
    throws Exception {
   
    TestInstances dataset = new TestInstances();
   
    dataset.setSeed(seed);
    dataset.setNumInstances(numInstances);
    dataset.setNumNominal   (attrTypes.nominal     ? numAttr : 0);
    dataset.setNumNumeric   (attrTypes.numeric     ? numAttr : 0);
    dataset.setNumString    (attrTypes.string      ? numAttr : 0);
    dataset.setNumDate      (attrTypes.date        ? numAttr : 0);
    dataset.setNumRelational(attrTypes.relational  ? numAttr : 0);
    dataset.setNumClasses(numClasses);
    dataset.setClassType(classType);
    dataset.setClassIndex(classIndex);
   
    return process(dataset.generate());
  }
View Full Code Here

  }
 
  protected Instances generateData(boolean nomClass, int numClasses,
      int numNominal, int numNumeric) throws Exception {
   
    TestInstances generator = new TestInstances();
   
    if (nomClass) {
      generator.setClassType(Attribute.NOMINAL);
      generator.setNumClasses(numClasses);
    } else {
      generator.setClassType(Attribute.NUMERIC);
    }
   
    generator.setNumNominal(numNominal);
    generator.setNumNumeric(numNumeric);
   
    generator.setNumDate(0);
    generator.setNumString(0);
    generator.setNumRelational(0);
    generator.setNumInstances(100);
   
    generator.setClassIndex(TestInstances.CLASS_IS_LAST);
    Instances data = generator.generate();
       
    return data;
  }
View Full Code Here

   *
   * @return    the dataset for the FilteredClassifier
   * @throws Exception  if generation of data fails
   */
  protected Instances getFilteredClassifierData() throws Exception {
    TestInstances  test;
    Instances    result;

    // NB: in order to make sure that the classifier can handle the data,
    //     we're using the classifier's capabilities to generate the data.
    test = TestInstances.forCapabilities(
    m_FilteredClassifier.getClassifier().getCapabilities());
    test.setClassIndex(TestInstances.CLASS_IS_LAST);

    result = test.generate();
   
    return result;
  }
View Full Code Here

TOP

Related Classes of weka.core.TestInstances

Copyright © 2018 www.massapicom. 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.