Package aima.core.learning.framework

Examples of aima.core.learning.framework.DataSet


        first.getAttributeValueAsString("sepal_length"));
  }

  @Test
  public void testNonDestructiveRemoveExample() throws Exception {
    DataSet ds1 = DataSetFactory.getRestaurantDataSet();
    DataSet ds2 = ds1.removeExample(ds1.getExample(0));
    Assert.assertEquals(12, ds1.size());
    Assert.assertEquals(11, ds2.size());
  }
View Full Code Here


  }

  @Test
  public void testNumerizesAndDeNumerizesIrisDataSetExample1()
      throws Exception {
    DataSet ds = DataSetFactory.getIrisDataSet();
    Example first = ds.getExample(0);
    Numerizer n = new IrisDataSetNumerizer();
    Pair<List<Double>, List<Double>> io = n.numerize(first);

    Assert.assertEquals(Arrays.asList(5.1, 3.5, 1.4, 0.2), io.getFirst());
    Assert.assertEquals(Arrays.asList(0.0, 0.0, 1.0), io.getSecond());
View Full Code Here

  }

  @Test
  public void testNumerizesAndDeNumerizesIrisDataSetExample2()
      throws Exception {
    DataSet ds = DataSetFactory.getIrisDataSet();
    Example first = ds.getExample(51);
    Numerizer n = new IrisDataSetNumerizer();
    Pair<List<Double>, List<Double>> io = n.numerize(first);

    Assert.assertEquals(Arrays.asList(6.4, 3.2, 4.5, 1.5), io.getFirst());
    Assert.assertEquals(Arrays.asList(0.0, 1.0, 0.0), io.getSecond());
View Full Code Here

  }

  @Test
  public void testNumerizesAndDeNumerizesIrisDataSetExample3()
      throws Exception {
    DataSet ds = DataSetFactory.getIrisDataSet();
    Example first = ds.getExample(100);
    Numerizer n = new IrisDataSetNumerizer();
    Pair<List<Double>, List<Double>> io = n.numerize(first);

    Assert.assertEquals(Arrays.asList(6.3, 3.3, 6.0, 2.5), io.getFirst());
    Assert.assertEquals(Arrays.asList(1.0, 0.0, 0.0), io.getSecond());
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.