Package org.encog.ml.bayesian.training.search.k2

Examples of org.encog.ml.bayesian.training.search.k2.SearchK2


        MLTrainFactory.PROPERTY_MAX_PARENTS, false, 1);
    String searchStr = holder.getString("SEARCH", false, "k2");
    String estimatorStr = holder.getString("ESTIMATOR", false, "simple");
    String initStr = holder.getString("INIT", false, "naive");
   
    BayesSearch search;
    BayesEstimator estimator;
    BayesianInit init;
   
    if( searchStr.equalsIgnoreCase("k2")) {
      search = new SearchK2();
View Full Code Here


    BayesSearch search;
    BayesEstimator estimator;
    BayesianInit init;
   
    if( searchStr.equalsIgnoreCase("k2")) {
      search = new SearchK2();
    } else if( searchStr.equalsIgnoreCase("none")) {
      search = new SearchNone();
    }
    else {
      throw new BayesianError("Invalid search type: " + searchStr);
View Full Code Here

    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);
    p = search.calculateG(network, x2, x2.getParents());
    Assert.assertEquals(0.0011111, p, 0.0001)
   
    network.createDependency(x2, x3);
    p = search.calculateG(network, x3, x3.getParents());
    Assert.assertEquals(0.0011111, p, 0.00555555);     
  }
View Full Code Here

   *            The max number of parents.
   */
  public TrainBayesian(BayesianNetwork theNetwork, MLDataSet theData,
      int theMaximumParents) {
    this(theNetwork, theData, theMaximumParents,
        BayesianInit.InitNaiveBayes, new SearchK2(),
        new SimpleEstimator());
  }
View Full Code Here

TOP

Related Classes of org.encog.ml.bayesian.training.search.k2.SearchK2

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.