Package weka.core

Examples of weka.core.TestInstances


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

    test = TestInstances.forCapabilities(m_FilteredClassifier.getCapabilities());
    test.setClassIndex(TestInstances.CLASS_IS_LAST);

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


   * @throws Exception if an error occurs reading the example instances.
   */
  protected void setUp() throws Exception {
    super.setUp();

    TestInstances test = new TestInstances();
    test.setNumNominal(0);
    test.setNumNumeric(2);
    test.setClassType(Attribute.NUMERIC);
    m_Instances = test.generate();
  }
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;

    test = TestInstances.forCapabilities(m_FilteredClassifier.getCapabilities());
    test.setClassIndex(TestInstances.CLASS_IS_LAST);

    result = test.generate();
   
    return result;
  }
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;

    test = new TestInstances();
    test.setNumNominal(0);
    test.setNumNumeric(6);
    test.setClassType(Attribute.NOMINAL);
    test.setClassIndex(TestInstances.CLASS_IS_LAST);

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

   * @throws Exception if an error occurs reading the example instances.
   */
  protected void setUp() throws Exception {
    super.setUp();

    TestInstances test = new TestInstances();
    test.setNumNominal(2);
    test.setClassType(Attribute.NOMINAL);
    test.setNumInstances(400);
    m_Instances = test.generate();
  }
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.setNumInstances(40);
    test.setClassIndex(TestInstances.CLASS_IS_LAST);

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

  /**
   * Create a dataset with relational attributes to work on
   */
  protected void setUp() throws Exception {
    TestInstances  test;

    super.setUp();

    test = new TestInstances();
   
    test.setNumDate(1);
    test.setNumNominal(1);
    test.setNumNominalValues(10);
    test.setNumNumeric(1);
    test.setNumRelational(2);
    test.setNumString(0);
    test.setNumRelationalDate(2);
    test.setNumRelationalNominal(2);
    test.setNumRelationalNumeric(2);
    test.setNumRelationalString(0);
    test.setNumRelationalNominalValues(10);

    m_Instances = test.generate();
  }
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

   * returns the test data generator
   *
   * @return   the configured test data generator
   */
  protected TestInstances getTestInstances() {
    return new TestInstances();
  }
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

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.