org.encog.ml.bayesian.query
Interface BayesianQuery
-
- All Superinterfaces:
- java.lang.Cloneable
- All Known Implementing Classes:
- BasicQuery, EnumerationQuery, SamplingQuery
public interface BayesianQuery extends java.lang.CloneableA 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
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description BayesianQueryclone()voiddefineEventType(BayesianEvent event, EventType et)Define an event type to be either hidden(default), evidence(input) or outcome (output).voidexecute()Execute the query.voidfinalizeStructure()java.util.Map<BayesianEvent,EventState>getEvents()EventStategetEventState(BayesianEvent event)Get the event state for a given event.EventTypegetEventType(BayesianEvent event)Get the event type.java.util.List<BayesianEvent>getEvidenceEvents()BayesianNetworkgetNetwork()java.util.List<BayesianEvent>getOutcomeEvents()doublegetProbability()java.lang.StringgetProblem()voidlocateEventTypes()Called to locate the evidence and outcome events.voidreset()Reset all event types back to hidden.voidsetEventValue(BayesianEvent event, boolean b)Set the event value to a boolean.voidsetEventValue(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
java.util.Map<BayesianEvent,EventState> getEvents()
- Returns:
- A mapping of events to event states.
-
getEvidenceEvents
java.util.List<BayesianEvent> getEvidenceEvents()
- Returns:
- The evidence events (inputs).
-
getOutcomeEvents
java.util.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
java.lang.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()
-
-
DMelt 3.0 © DataMelt by jWork.ORG