Package org.encog.ml.bayesian.query.sample

Examples of org.encog.ml.bayesian.query.sample.SamplingQuery


    if (queryType.length() > 0) {
      BayesianQuery query = null;
      if (queryType.equals("EnumerationQuery")) {
        query = new EnumerationQuery(result);
      } else {
        query = new SamplingQuery(result);
      }

      if (query != null && queryStr.length()>0) {
        result.setQuery(query);
        result.defineClassificationStructure(queryStr);
View Full Code Here


    a.getTable().addLine(0.5, true); // P(A) = 0.5
    b.getTable().addLine(0.2, true, true); // p(b|a) = 0.2
    b.getTable().addLine(0.8, true, false);// p(b|~a) = 0.8   
    network.validate();
   
    SamplingQuery query = new SamplingQuery(network);
    query.defineEventType(a, EventType.Evidence);
    query.defineEventType(b, EventType.Outcome);
    query.setEventValue(b, true);
    query.setEventValue(a, true);
    query.execute();
    testPercent(query.getProbability(),20);
  }
View Full Code Here

    x2.getTable().addLine(0.6, true, false);// p(x2|~a) = 0.6
    x3.getTable().addLine(0.2, true, true); // p(x3|a) = 0.2
    x3.getTable().addLine(0.6, true, false);// p(x3|~a) = 0.6
    network.validate();
   
    SamplingQuery query = new SamplingQuery(network);
    query.defineEventType(x1, EventType.Evidence);
    query.defineEventType(x2, EventType.Evidence);
    query.defineEventType(x3, EventType.Evidence);
    query.defineEventType(a, EventType.Outcome);
    query.setEventValue(a, true);
    query.setEventValue(x1, true);
    query.setEventValue(x2, true);
    query.setEventValue(x3, false);
    query.execute();
    testPercent(query.getProbability(),18);
  }
View Full Code Here

    x2.getTable().addLine(0.6, true, false);// p(x2|~a) = 0.6
    x3.getTable().addLine(0.2, true, true); // p(x3|a) = 0.2
    x3.getTable().addLine(0.6, true, false);// p(x3|~a) = 0.6
    network.validate();
   
    SamplingQuery query = new SamplingQuery(network);
    query.defineEventType(x1, EventType.Evidence);
    query.defineEventType(x3, EventType.Outcome);
    query.setEventValue(x1, true);
    query.setEventValue(x3, true);
    query.execute();
    testPercent(query.getProbability(),50);
  }
View Full Code Here

TOP

Related Classes of org.encog.ml.bayesian.query.sample.SamplingQuery

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.