Examples of classValue()


Examples of weka.core.Instance.classValue()

    // ... calculate the counts
    Enumeration enu = data.enumerateInstances();
    while (enu.hasMoreElements()) {
      Instance i = (Instance) enu.nextElement();
      if (i.isMissing(attr)) {
  missingValueCounts[(int) i.classValue()]++;
      } else {
  counts[(int) i.value(attr)][(int) i.classValue()]++;
      }
    }
View Full Code Here

Examples of weka.core.Instance.classValue()

    while (enu.hasMoreElements()) {
      Instance i = (Instance) enu.nextElement();
      if (i.isMissing(attr)) {
  missingValueCounts[(int) i.classValue()]++;
      } else {
  counts[(int) i.value(attr)][(int) i.classValue()]++;
      }
    }

    OneRRule r = new OneRRule(data, attr); // create a new rule
    for (int value = 0; value < attr.numValues(); value++) {
View Full Code Here

Examples of weka.core.Instance.classValue()

      m_MaxTarget = -Double.MAX_VALUE;

      for (int i = 0; i < train.numInstances(); i++) {
        Instance currentInst = train.instance(i);
        if (!currentInst.classIsMissing()) {
          addNumericTrainClass(currentInst.classValue(), currentInst.weight());
        }
      }

      m_ClassPriors[0] = m_ClassPriorsSum = 0;
      for (int i = 0; i < train.numInstances(); i++) {
View Full Code Here

Examples of weka.core.Instance.classValue()

      for (int i = 0; i < m_TransformedData.numInstances(); i ++) {
  Instance inst = m_TransformedData.instance(i);
  int column = 0;
  for (int j = 0; j < m_TransformedData.numAttributes(); j++) {
    if (j == m_ClassIndex) {
      dependent.setElement(i, 0, inst.classValue());
    } else {
      if (selectedAttributes[j]) {
        double value = inst.value(j) - m_Means[j];
       
        // We only need to do this if we want to
View Full Code Here

Examples of weka.core.Instance.classValue()

      testClassifier.trainingData.add(testClassifier.constructInstance(new int []{-1,-1,1,0},false));
    }
    weka.classifiers.trees.J48 cl = new weka.classifiers.trees.J48();
    cl.buildClassifier(testClassifier.trainingData);
    Instance instance = testClassifier.constructInstance(new int []{1,0,1,0},true);
    Assert.assertEquals(instance.classValue(), cl.classifyInstance(instance),Configuration.fpAccuracy);
   
    instance = testClassifier.constructInstance(new int []{-1,0,1,0},false);
    Assert.assertEquals(instance.classValue(), cl.classifyInstance(instance),Configuration.fpAccuracy);
   
    instance = testClassifier.constructInstance(new int []{0,0,1,0},true);
View Full Code Here

Examples of weka.core.Instance.classValue()

    cl.buildClassifier(testClassifier.trainingData);
    Instance instance = testClassifier.constructInstance(new int []{1,0,1,0},true);
    Assert.assertEquals(instance.classValue(), cl.classifyInstance(instance),Configuration.fpAccuracy);
   
    instance = testClassifier.constructInstance(new int []{-1,0,1,0},false);
    Assert.assertEquals(instance.classValue(), cl.classifyInstance(instance),Configuration.fpAccuracy);
   
    instance = testClassifier.constructInstance(new int []{0,0,1,0},true);
    Assert.assertEquals(instance.classValue(), cl.classifyInstance(instance),Configuration.fpAccuracy);
  }
 
View Full Code Here

Examples of weka.core.Instance.classValue()

   
    instance = testClassifier.constructInstance(new int []{-1,0,1,0},false);
    Assert.assertEquals(instance.classValue(), cl.classifyInstance(instance),Configuration.fpAccuracy);
   
    instance = testClassifier.constructInstance(new int []{0,0,1,0},true);
    Assert.assertEquals(instance.classValue(), cl.classifyInstance(instance),Configuration.fpAccuracy);
  }
 
  @Test
  public void TestUniqueIntoState1()
  {
View Full Code Here

Examples of weka.core.Instance.classValue()

   
    instance = testClassifier.constructInstance(new int []{-1,0,1,0},false);
    Assert.assertEquals(instance.classValue(), cl.classifyInstance(instance),Configuration.fpAccuracy);
   
    instance = testClassifier.constructInstance(new int []{0,0,1,0},true);
    Assert.assertEquals(instance.classValue(), cl.classifyInstance(instance),Configuration.fpAccuracy);
  }
 
  @Test
  public void TestUniqueIntoState1()
  {
View Full Code Here

Examples of weka.core.Instance.classValue()

      testClassifier.trainingData.add(testClassifier.constructInstance(new int []{-1,-1,1,0},false));
    }
    weka.classifiers.trees.J48 cl = new weka.classifiers.trees.J48();
    cl.buildClassifier(testClassifier.trainingData);
    Instance instance = testClassifier.constructInstance(new int []{1,0,1,0},true);
    Assert.assertEquals(instance.classValue(), cl.classifyInstance(instance),Configuration.fpAccuracy);
   
    instance = testClassifier.constructInstance(new int []{-1,0,1,0},false);
    Assert.assertEquals(instance.classValue(), cl.classifyInstance(instance),Configuration.fpAccuracy);
   
    instance = testClassifier.constructInstance(new int []{0,0,1,0},true);
View Full Code Here

Examples of weka.core.Instance.classValue()

    cl.buildClassifier(testClassifier.trainingData);
    Instance instance = testClassifier.constructInstance(new int []{1,0,1,0},true);
    Assert.assertEquals(instance.classValue(), cl.classifyInstance(instance),Configuration.fpAccuracy);
   
    instance = testClassifier.constructInstance(new int []{-1,0,1,0},false);
    Assert.assertEquals(instance.classValue(), cl.classifyInstance(instance),Configuration.fpAccuracy);
   
    instance = testClassifier.constructInstance(new int []{0,0,1,0},true);
    Assert.assertEquals(instance.classValue(), cl.classifyInstance(instance),Configuration.fpAccuracy);
  }
 
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.