Examples of predict()


Examples of aima.core.learning.learners.DecisionListLearner.predict()

    DecisionListLearner learner = new DecisionListLearner("Yes", "No",
        new MockDLTestFactory(new ArrayList<DLTest>()));
    DataSet ds = DataSetFactory.getRestaurantDataSet();
    learner.train(ds);
    Assert.assertEquals(DecisionListLearner.FAILURE,
        learner.predict(ds.getExample(0)));
  }

  @Test
  public void testDecisionListTestRunOnRestaurantDataSet() throws Exception {
    DataSet ds = DataSetFactory.getRestaurantDataSet();
View Full Code Here

Examples of aima.core.learning.learners.DecisionTreeLearner.predict()

    DataSet ds2 = ds.emptyDataSet();
    Assert.assertEquals(0, ds2.size());

    learner.train(ds2);
    Assert.assertEquals("Unable To Classify",
        learner.predict(ds.getExample(0)));
  }

  @Test
  public void testClassificationReturnedWhenAllExamplesHaveTheSameClassification()
      throws Exception {
View Full Code Here

Examples of aima.core.learning.learners.DecisionTreeLearner.predict()

    ds2.add(ds.getExample(0));
    ds2.add(ds.getExample(2));
    ds2.add(ds.getExample(3));

    learner.train(ds2);
    Assert.assertEquals("Yes", learner.predict(ds.getExample(0)));
  }

  @Test
  public void testMajorityReturnedWhenAttributesToExamineIsEmpty()
      throws Exception {
View Full Code Here

Examples of aima.core.learning.learners.DecisionTreeLearner.predict()

    ds2.add(ds.getExample(2));
    ds2.add(ds.getExample(3));
    ds2.setSpecification(new MockDataSetSpecification("will_wait"));

    learner.train(ds2);
    Assert.assertEquals("Yes", learner.predict(ds.getExample(1)));
  }

  @Test
  public void testInducedTreeClassifiesDataSetCorrectly() throws Exception {
    DataSet ds = DataSetFactory.getRestaurantDataSet();
View Full Code Here

Examples of com.deafgoat.ml.prognosticator.Experimenter.predict()

        // Build the model.
        experimenter.buildModel();

        // Run the prediction
        experimenter.predict();

    }
}
View Full Code Here

Examples of com.mockturtlesolutions.snifflib.invprobs.Lpreg.predict()

      //

      DblMatrix xx[] = new DblMatrix[1];
      xx[0] = DblMatrix.span(min,max,2*outSet.getRowCount());

                  DblMatrix yy = FUNC.predict(xx);
                  if (this.fitline == null)
      {
        this.fitline = new SLLine(plotPanel.getAxes());
        this.fitline.setMarkerType(8);
        this.fitline.setLineColor(Color.red);
View Full Code Here

Examples of com.mockturtlesolutions.snifflib.invprobs.Lpreg.predict()

          {
            if (((Integer)this.adjustForMap.get("adjustForSmoothingMethod")).intValue() == DefaultComplexBufferPredictorGenerator.LOWESS_SMOOTHING)
            {
              SmoothingCbResidual.setDblAt(thisPointCb,smoothingDataIndex);
              SmoothingSmoother.useSufficient(false);
              DblMatrix complexCbContribution = SmoothingSmoother.predict(new DblMatrix[]{SmoothingpH.getDblAt(smoothingDataIndex)});
              thisPointCb = thisPointCb.minus(complexCbContribution);
           
              //System.out.println("Done with one!");
            }
            else if (((Integer)this.adjustForMap.get("adjustForSmoothingMethod")).intValue() == DefaultComplexBufferPredictorGenerator.POLYNOMIAL_SMOOTHING)
View Full Code Here

Examples of com.nr.ci.Svm.predict()

    int nerror=0;
    for (i=0;i<M;i++) {
//      if (i%10 == 0) System.out.printf((y[i]==1.0) << " %f\n", (linsvm.predict(i) >= 1.0));
//      if ((y[i] == 1.0) != (linsvm.predict(i) >= 1.0))
//        System.out.printf(data[i][0] << " %f\n", data[i][1] << " %f\n", y[i] << " %f\n", linsvm.predict(i));
      nerror += ((y[i]==1.0) != (linsvm.predict(i) >= 0.0) ? 1 : 0);
    }
    System.out.printf("Errors: %d\n", nerror);

    // Polynomial kernel
    Svmpolykernel polykernel=new Svmpolykernel(data,y,1.0,1.0,2.0);
View Full Code Here

Examples of com.nr.ci.Svm.predict()

//      System.out.printf(test);
      k++;
    } while (test > 1.e-3 && k < 100);
    nerror=0;
    for (i=0;i<M;i++) {
      nerror += ((y[i]==1.0) != (polysvm.predict(i) >= 0.0) ? 1 : 0);
    }
    System.out.printf("Errors: %d\n", nerror);

    // Gaussian kernel
    Svmgausskernel gausskernel=new Svmgausskernel(data,y,1.0);
View Full Code Here

Examples of com.nr.ci.Svm.predict()

//      System.out.printf(test);
      k++;
    } while (test > 1.e-3 && k < 100);
    nerror=0;
    for (i=0;i<M;i++) {
      nerror += ((y[i]==1.0) != (gausssvm.predict(i) >= 0.0) ? 1 : 0);
    }
    System.out.printf("Errors: %d\n", nerror);

   
    // Need to add tests for harder test case and resolve issue that the two
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.