Package weka.datagenerators

Examples of weka.datagenerators.Test


                                   + getMinRuleSize();

    RuleList newRule = new RuleList();
    for (int i=0; i < ruleSize; i++) {
      int testIndex = (int) (random.nextDouble() * (double) TestList.size());
      Test test = (Test) TestList.elementAt(testIndex);
         
      newRule.addTest(test);
      TestList.removeElementAt(testIndex);
    }
    double newClassValue = 0.0;
View Full Code Here


    FastVector TestList = new FastVector(numTests);
    boolean[] irrelevant = getAttList_Irr();

    for (int i = 0; i < getNumAttributes(); i++) {
      if (!irrelevant[i]) {
        Test newTest = null;
        Attribute att = example.attribute(i);
        if (att.isNumeric()) {
          double newSplit = random.nextDouble();
          boolean newNot = newSplit < example.value(i);
          newTest = new Test(i, newSplit, format, newNot);
        } else {
          newTest = new Test(i, example.value(i), format, false);
        }
      TestList.addElement (newTest);    
      }
    }
   
View Full Code Here

     */
    private double classifyInstance (Instance example) throws Exception {
      boolean passedAllTests = true;
      for (Enumeration e = m_RuleList.elements();
     passedAllTests && e.hasMoreElements(); ) {
  Test test = (Test) e.nextElement();
  passedAllTests = test.passesTest(example);
      }
      if (passedAllTests) return m_ClassValue;
      else return -1.0;
    }
View Full Code Here

    public String toString () {
      StringBuffer str = new StringBuffer();
      str = str.append("  c" + (int) m_ClassValue + " := ");
      Enumeration e = m_RuleList.elements();
      if (e.hasMoreElements()) {
  Test test = (Test) e.nextElement();
  str = str.append(test.toPrologString());
      }
      while (e.hasMoreElements()) {
  Test test = (Test) e.nextElement();
  str = str.append(", " + test.toPrologString());      
      }
      return str.toString();
    }
View Full Code Here

     */
    private double classifyInstance (Instance example) throws Exception {
      boolean passedAllTests = true;
      for (Enumeration e = m_RuleList.elements();
     passedAllTests && e.hasMoreElements(); ) {
  Test test = (Test) e.nextElement();
  passedAllTests = test.passesTest(example);
      }
      if (passedAllTests) return m_ClassValue;
      else return -1.0;
    }
View Full Code Here

    public String toString () {
      StringBuffer str = new StringBuffer();
      str = str.append("  c" + (int) m_ClassValue + " := ");
      Enumeration e = m_RuleList.elements();
      if (e.hasMoreElements()) {
  Test test = (Test) e.nextElement();
  str = str.append(test.toPrologString());
      }
      while (e.hasMoreElements()) {
  Test test = (Test) e.nextElement();
  str = str.append(", " + test.toPrologString());      
      }
      return str.toString();
    }
View Full Code Here

                                   + getMinRuleSize();

    RuleList newRule = new RuleList();
    for (int i=0; i < ruleSize; i++) {
      int testIndex = (int) (random.nextDouble() * (double) TestList.size());
      Test test = (Test) TestList.elementAt(testIndex);
         
      newRule.addTest(test);
      TestList.removeElementAt(testIndex);
    }
    double newClassValue = 0.0;
View Full Code Here

    FastVector TestList = new FastVector(numTests);
    boolean[] irrelevant = getAttList_Irr();

    for (int i = 0; i < getNumAttributes(); i++) {
      if (!irrelevant[i]) {
        Test newTest = null;
        Attribute att = example.attribute(i);
        if (att.isNumeric()) {
          double newSplit = random.nextDouble();
          boolean newNot = newSplit < example.value(i);
          newTest = new Test(i, newSplit, format, newNot);
        } else {
          newTest = new Test(i, example.value(i), format, false);
        }
      TestList.addElement (newTest);    
      }
    }
   
View Full Code Here

     */
    private double classifyInstance (Instance example) throws Exception {
      boolean passedAllTests = true;
      for (Enumeration e = m_RuleList.elements();
     passedAllTests && e.hasMoreElements(); ) {
  Test test = (Test) e.nextElement();
  passedAllTests = test.passesTest(example);
      }
      if (passedAllTests) return m_ClassValue;
      else return -1.0;
    }
View Full Code Here

    public String toString () {
      StringBuffer str = new StringBuffer();
      str = str.append("  c" + (int) m_ClassValue + " := ");
      Enumeration e = m_RuleList.elements();
      if (e.hasMoreElements()) {
  Test test = (Test) e.nextElement();
  str = str.append(test.toPrologString());
      }
      while (e.hasMoreElements()) {
  Test test = (Test) e.nextElement();
  str = str.append(", " + test.toPrologString());      
      }
      return str.toString();
    }
View Full Code Here

TOP

Related Classes of weka.datagenerators.Test

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.