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.setNumRelational(0);
    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(NUM_NUMERIC_ATTS);
    test.setClassType(Attribute.NUMERIC);

    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(NUM_NUMERIC_ATTS);
    test.setClassType(Attribute.NUMERIC);
    m_Instances = test.generate();
  }
View Full Code Here

   *
   * @param nomClass  whether to use a nominal class with J48 (TRUE) or
   *       a numeric one with M5P (FALSE)
   */
  protected void performTest(boolean nomClass) {
    TestInstances  test;
    Instances    data;
    double[]    originalResults;
    double[]    testResults;
    int      i;

    // generate data
    try {
      test = new TestInstances();
      if (nomClass) {
  test.setClassType(Attribute.NOMINAL);
  test.setNumNominal(5);
  test.setNumNominalValues(4);
  test.setNumNumeric(0);
      }
      else {
  test.setClassType(Attribute.NUMERIC);
  test.setNumNominal(0);
  test.setNumNumeric(5);
      }
      test.setNumDate(0);
      test.setNumString(0);
      test.setNumRelational(0);
      test.setNumInstances(100);
      data = test.generate();
    }
    catch (Exception e) {
      fail("Generating test data failed: " + e);
      return;
    }
View Full Code Here

  public void testRegression() {
    Regression     reg;
    Instances     train;
    Instances     test;
    Instances     data;
    TestInstances  testInst;
    int     tot;
    int     mid;
    EvaluationUtils   evaluation;
    FastVector    regressionResults;
   
    reg = new Regression(this.getClass());

    // generate test data
    try {
      testInst = new TestInstances();
      testInst.setClassType(Attribute.NOMINAL);
      testInst.setNumNominal(5);
      testInst.setNumNominalValues(4);
      testInst.setNumNumeric(0);
      testInst.setNumDate(0);
      testInst.setNumString(0);
      testInst.setNumRelational(0);
      testInst.setNumInstances(100);
      data = testInst.generate();
    }
    catch (Exception e) {
      fail("Failed generating data: " + e);
      return;
    }
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

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

    TestInstances test = new TestInstances();
    test.setNumNominal(1);
    test.setClassType(Attribute.NOMINAL);
    test.setMultiInstance(true);
    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.setClassType(Attribute.NOMINAL);
    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 = TestInstances.forCapabilities(m_FilteredClassifier.getCapabilities());
    test.setNumRelational(0);
    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 = TestInstances.forCapabilities(m_FilteredClassifier.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.