Package org.encog.ml.bayesian.training

Examples of org.encog.ml.bayesian.training.TrainBayesian


    }
    else {
      throw new BayesianError("Invalid init type: " + initStr);
    }
   
    return new TrainBayesian((BayesianNetwork) method, training, maxParents, init, search, estimator);
  }
View Full Code Here


    BayesianNetwork network = new BayesianNetwork();
    BayesianEvent x1 = network.createEvent("x1", labels);
    BayesianEvent x2 = network.createEvent("x2", labels);
    BayesianEvent x3 = network.createEvent("x3", labels);
    network.finalizeStructure();
    TrainBayesian train = new TrainBayesian(network,data,10);
    train.setInitNetwork(BayesianInit.InitEmpty);
    while(!train.isTrainingDone()) {
      train.iteration();
    }
    train.iteration();
    Assert.assertTrue(x1.getParents().size()==0);
    Assert.assertTrue(x2.getParents().size()==1);
    Assert.assertTrue(x3.getParents().size()==1);
    Assert.assertTrue(x2.getParents().contains(x1));
    Assert.assertTrue(x3.getParents().contains(x2));
View Full Code Here

    BayesianNetwork network = new BayesianNetwork();
    BayesianEvent x1 = network.createEvent("x1", labels);
    BayesianEvent x2 = network.createEvent("x2", labels);
    BayesianEvent x3 = network.createEvent("x3", labels);
    network.finalizeStructure();
    TrainBayesian train = new TrainBayesian(network,data,10);
    SearchK2 search = (SearchK2)train.getSearch();
   
    double p = search.calculateG(network, x1, x1.getParents());
    Assert.assertEquals(3.607503E-4, p, 0.0001);
   
    network.createDependency(x1, x2);
View Full Code Here

TOP

Related Classes of org.encog.ml.bayesian.training.TrainBayesian

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.