Examples of ParsedProbability


Examples of org.encog.ml.bayesian.parse.ParsedProbability

   * @param line The event.
   * @param probability The probability.
   */
  public void defineProbability(String line, double probability) {
    ParseProbability parse = new ParseProbability(this);
    ParsedProbability parsedProbability = parse.parse(line);
    parsedProbability.defineTruthTable(this, probability);
  }
View Full Code Here

Examples of org.encog.ml.bayesian.parse.ParsedProbability

   * Define a relationship.
   * @param line The relationship to define.
   */
  public void defineRelationship(String line) {
    ParseProbability parse = new ParseProbability(this);
    ParsedProbability parsedProbability = parse.parse(line);
    parsedProbability.defineRelationships(this);
  }
View Full Code Here

Examples of org.encog.ml.bayesian.parse.ParsedProbability

    if( this.query==null ) {
      throw new BayesianError("This Bayesian network does not have a query to define.");
    }
   
    ParseProbability parse = new ParseProbability(this);
    ParsedProbability parsedProbability = parse.parse(line);
   
    // create a temp query
    BayesianQuery q = this.query.clone();
   
    // first, mark all events as hidden
    q.reset();
   
    // deal with evidence (input)
    for( ParsedEvent parsedEvent : parsedProbability.getGivenEvents() ) {
      BayesianEvent event = this.requireEvent(parsedEvent.getLabel());
      q.defineEventType(event, EventType.Evidence);
      q.setEventValue(event, parsedEvent.resolveValue(event));
    }
   
    // deal with outcome (output)
    for( ParsedEvent parsedEvent : parsedProbability.getBaseEvents() ) {
      BayesianEvent event = requireEvent(parsedEvent.getLabel());
      q.defineEventType(event, EventType.Outcome);
      q.setEventValue(event, parsedEvent.resolveValue(event));
    }
   
View Full Code Here

Examples of org.encog.ml.bayesian.parse.ParsedProbability

    for(BayesianEvent event: this.events) {
      this.query.defineEventType(event, EventType.Hidden);
    }
   
    // define the base event
    ParsedProbability prob = list.get(0);
       
    if( prob.getBaseEvents().size()==0 ) {
      return;
    }
   
    BayesianEvent be = this.getEvent( prob.getChildEvent().getLabel() );
    this.classificationTarget = this.events.indexOf(be);
    this.query.defineEventType(be, EventType.Outcome);
   
    // define the given events
    for(ParsedEvent parsedGiven: prob.getGivenEvents()) {
      BayesianEvent given = this.getEvent( parsedGiven.getLabel() );
      this.query.defineEventType(given, EventType.Evidence);
    }
   
    this.query.locateEventTypes();
   
    // set the values
    for(ParsedEvent parsedGiven: prob.getGivenEvents()) {
      BayesianEvent event = this.getEvent( parsedGiven.getLabel() );
      this.query.setEventValue(event, parseInt(parsedGiven.getValue()) );
    }
   
    this.query.setEventValue(be, parseInt(prob.getBaseEvents().get(0).getValue()) );   
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.