Package aima.core.learning.framework

Examples of aima.core.learning.framework.DataSet


    System.out.println(Util.ntimes("*", 100));
    System.out
        .println("\n Ensemble Decision Demo - Weak Learners co operating to give Superior decisions ");
    System.out.println(Util.ntimes("*", 100));
    try {
      DataSet ds = DataSetFactory.getRestaurantDataSet();
      List<DecisionTree> stumps = DecisionTree.getStumpsFor(ds, "Yes", "No");
      List<Learner> learners = new ArrayList<Learner>();

      System.out
          .println("\nStump Learners vote to decide in this algorithm");
View Full Code Here


    try {
      System.out.println(Util.ntimes("*", 100));
      System.out
          .println("\n Perceptron Demo - Running Perceptron on Iris data Set with 10 epochs of learning ");
      System.out.println(Util.ntimes("*", 100));
      DataSet irisDataSet = DataSetFactory.getIrisDataSet();
      Numerizer numerizer = new IrisDataSetNumerizer();
      NNDataSet innds = new IrisNNDataSet();

      innds.createExamplesFromDataSet(irisDataSet, numerizer);

View Full Code Here

      System.out.println(Util.ntimes("*", 100));
      System.out
          .println("\n BackpropagationDemo  - Running BackProp on Iris data Set with 10 epochs of learning ");
      System.out.println(Util.ntimes("*", 100));

      DataSet irisDataSet = DataSetFactory.getIrisDataSet();
      Numerizer numerizer = new IrisDataSetNumerizer();
      NNDataSet innds = new IrisNNDataSet();

      innds.createExamplesFromDataSet(irisDataSet, numerizer);

View Full Code Here

    Assert.assertEquals(0.6061, outputLayerBias.getValue(0), 0.001);
  }

  @Test
  public void testDataSetPopulation() throws Exception {
    DataSet irisDataSet = DataSetFactory.getIrisDataSet();
    Numerizer numerizer = new IrisDataSetNumerizer();
    NNDataSet innds = new IrisNNDataSet();

    innds.createExamplesFromDataSet(irisDataSet, numerizer);
View Full Code Here

    ffnn.testOnDataSet(innds);
  }

  @Test
  public void testPerceptron() throws Exception {
    DataSet irisDataSet = DataSetFactory.getIrisDataSet();
    Numerizer numerizer = new IrisDataSetNumerizer();
    NNDataSet innds = new IrisNNDataSet();

    innds.createExamplesFromDataSet(irisDataSet, numerizer);
View Full Code Here

        Util.information(loadedCoinProbabilities), 0.000000000000000001);
  }

  @Test
  public void testBasicDataSetInformationCalculation() throws Exception {
    DataSet ds = DataSetFactory.getRestaurantDataSet();
    double infoForTargetAttribute = ds.getInformationFor();// this should
    // be the
    // generic
    // distribution
    Assert.assertEquals(1.0, infoForTargetAttribute, 0.001);
  }
View Full Code Here

    Assert.assertEquals(1.0, infoForTargetAttribute, 0.001);
  }

  @Test
  public void testDataSetSplit() throws Exception {
    DataSet ds = DataSetFactory.getRestaurantDataSet();
    Hashtable<String, DataSet> hash = ds.splitByAttribute("patrons");// this
    // should
    // be
    // the
    // generic
    // distribution
View Full Code Here

    Assert.assertEquals(4, hash.get("Some").size());
  }

  @Test
  public void testGainCalculation() throws Exception {
    DataSet ds = DataSetFactory.getRestaurantDataSet();
    double gain = ds.calculateGainFor("patrons");
    Assert.assertEquals(0.541, gain, 0.001);
    gain = ds.calculateGainFor("type");
    Assert.assertEquals(0.0, gain, 0.001);
  }
View Full Code Here

  @Test
  public void testDecisonListWithNoTestsReturnsDefaultValue()
      throws Exception {
    DecisionList dlist = new DecisionList("Yes", "No");
    DataSet ds = DataSetFactory.getRestaurantDataSet();
    Assert.assertEquals("No", dlist.predict(ds.getExample(0)));
  }
View Full Code Here

  @Test
  public void testDecisionListWithSingleTestReturnsTestValueIfTestSuccessful()
      throws Exception {
    DecisionList dlist = new DecisionList("Yes", "No");
    DataSet ds = DataSetFactory.getRestaurantDataSet();

    DLTest test = new DLTest();
    test.add("type", "French");

    dlist.add(test, "test1success");

    Assert.assertEquals("test1success", dlist.predict(ds.getExample(0)));
  }
View Full Code Here

TOP

Related Classes of aima.core.learning.framework.DataSet

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.