Package aima.core.learning.neural

Examples of aima.core.learning.neural.RabbitEyeDataSet


  DataSetSpecification spec;

  @Test
  public void testNormalizationOfFileBasedDataProducesCorrectMeanStdDevAndNormalizedValues()
      throws Exception {
    RabbitEyeDataSet reds = new RabbitEyeDataSet();
    reds.createNormalizedDataFromFile("rabbiteyes");

    List<Double> means = reds.getMeans();
    Assert.assertEquals(2, means.size());
    Assert.assertEquals(244.771, means.get(0), 0.001);
    Assert.assertEquals(145.505, means.get(1), 0.001);

    List<Double> stdev = reds.getStdevs();
    Assert.assertEquals(2, stdev.size());
    Assert.assertEquals(213.554, stdev.get(0), 0.001);
    Assert.assertEquals(65.776, stdev.get(1), 0.001);

    List<List<Double>> normalized = reds.getNormalizedData();
    Assert.assertEquals(70, normalized.size());

    // check first value
    Assert.assertEquals(-1.0759, normalized.get(0).get(0), 0.001);
    Assert.assertEquals(-1.882, normalized.get(0).get(1), 0.001);
View Full Code Here


    Assert.assertEquals(1.538, normalized.get(69).get(1), 0.001);
  }

  @Test
  public void testExampleFormation() throws Exception {
    RabbitEyeDataSet reds = new RabbitEyeDataSet();
    reds.createExamplesFromFile("rabbiteyes");
    Assert.assertEquals(70, reds.howManyExamplesLeft());
    reds.getExampleAtRandom();
    Assert.assertEquals(69, reds.howManyExamplesLeft());
    reds.getExampleAtRandom();
    Assert.assertEquals(68, reds.howManyExamplesLeft());
  }
View Full Code Here

TOP

Related Classes of aima.core.learning.neural.RabbitEyeDataSet

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.