org.encog.ml.bayesian.query
Interface BayesianQuery

All Superinterfaces:
Cloneable
All Known Implementing Classes:
BasicQuery, EnumerationQuery, SamplingQuery

public interface BayesianQuery
extends Cloneable

A Bayesian query. This is used to query a Bayesian network and determine a the probability of an output, given some input. The input is called evidence, and the output is the outcome. This results in a final probability of the output being what you specified. You can easily change the events between evidence and outcome, this allows the Bayesian network to be queried in nearly any way. It is also possible to omit missing evidence to handle missing data.


Method Summary
 BayesianQuery clone()
           
 void defineEventType(BayesianEvent event, EventType et)
          Define an event type to be either hidden(default), evidence(input) or outcome (output).
 void execute()
          Execute the query.
 void finalizeStructure()
           
 Map<BayesianEvent,EventState> getEvents()
           
 EventState getEventState(BayesianEvent event)
          Get the event state for a given event.
 EventType getEventType(BayesianEvent event)
          Get the event type.
 List<BayesianEvent> getEvidenceEvents()
           
 BayesianNetwork getNetwork()
           
 List<BayesianEvent> getOutcomeEvents()
           
 double getProbability()
           
 String getProblem()
           
 void locateEventTypes()
          Called to locate the evidence and outcome events.
 void reset()
          Reset all event types back to hidden.
 void setEventValue(BayesianEvent event, boolean b)
          Set the event value to a boolean.
 void setEventValue(BayesianEvent event, int d)
          Set the event value as a class item.
 

Method Detail

getNetwork

BayesianNetwork getNetwork()
Returns:
The Bayesian network that we are using this query for.

getEvents

Map<BayesianEvent,EventState> getEvents()
Returns:
A mapping of events to event states.

getEvidenceEvents

List<BayesianEvent> getEvidenceEvents()
Returns:
The evidence events (inputs).

getOutcomeEvents

List<BayesianEvent> getOutcomeEvents()
Returns:
The outcome events (outputs).

reset

void reset()
Reset all event types back to hidden.


defineEventType

void defineEventType(BayesianEvent event,
                     EventType et)
Define an event type to be either hidden(default), evidence(input) or outcome (output).

Parameters:
event - The event to define.
et - THe new event type.

getEventState

EventState getEventState(BayesianEvent event)
Get the event state for a given event.

Parameters:
event - The event to get the state for.
Returns:
The event state.

getEventType

EventType getEventType(BayesianEvent event)
Get the event type.

Parameters:
event - The event to check.
Returns:
The current event type for this event.

setEventValue

void setEventValue(BayesianEvent event,
                   boolean b)
Set the event value to a boolean.

Parameters:
event - The event.
b - The value.

setEventValue

void setEventValue(BayesianEvent event,
                   int d)
Set the event value as a class item.

Parameters:
event - The event to set.
d - An integer class item.

getProblem

String getProblem()
Returns:
Return a string that represents this query as a probability "problem".

execute

void execute()
Execute the query.


getProbability

double getProbability()
Returns:
Obtains the probability after execute has been called.

finalizeStructure

void finalizeStructure()

locateEventTypes

void locateEventTypes()
Called to locate the evidence and outcome events.


clone

BayesianQuery clone()


Copyright © 2014. All Rights Reserved.