Interface QueryOptions
-
- All Known Implementing Classes:
BackdoorQueryOptions
,CausalQueryOptionsBase
,DisjunctiveCauseQueryOptions
,FrontDoorQueryOptions
,LikelihoodSamplingQueryOptions
,LoopyBeliefQueryOptions
,RelevanceTreeQueryOptions
,TreeQueryOptions
,VariableEliminationQueryOptions
public interface QueryOptions
Options that govern the calculations performed byInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput)
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Cancellation
getCancellation()
Allows cancellation of a query.CausalEffectKind
getCausalEffectKind()
Gets the kind of effect to calculate.InferenceFactory
getCausalInferenceFactory()
Factory that can create inference engines, used by estimation (adjustment) algorithms to perform queries on the Bayesian network.boolean
getConflict()
Gets a value indicating whether the conflict measure should be calculated in a call toInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput)
.DecisionAlgorithm
getDecisionAlgorithm()
Gets the algorithm to use when a network contains Decision nodes.InconsistentEvidenceMode
getInconsistentEvidenceMode()
Determines when anInconsistentEvidenceException
is raised.boolean
getLogLikelihood()
Gets a value indicating whether the log-likelihood of a case should be calculated in a call toInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput)
.PropagationMethod
getPropagation()
Gets the propagation method to be used during inference.QueryEvidenceMode
getQueryEvidenceMode()
Determines whether evidence is retracted for each query.Integer
getTerminalTime()
Gets the terminal time, which is the time at which any terminal nodes in a Dynamic Bayesian Network connect to temporal nodes.void
setCancellation(Cancellation value)
Allows cancellation of a query.void
setCausalEffectKind(CausalEffectKind value)
Sets the kind of effect to calculate.void
setCausalInferenceFactory(InferenceFactory value)
Factory that can create inference engines, used by estimation (adjustment) algorithms to perform queries on the Bayesian network.void
setConflict(boolean value)
Sets a value indicating whether the conflict measure should be calculated in a call toInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput)
.void
setDecisionAlgorithm(DecisionAlgorithm value)
Sets the algorithm to use when a network contains Decision nodes.void
setInconsistentEvidenceMode(InconsistentEvidenceMode value)
Determines when anInconsistentEvidenceException
is raised.void
setLogLikelihood(boolean value)
Sets a value indicating whether the log-likelihood of a case should be calculated in a call toInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput)
.void
setPropagation(PropagationMethod value)
Sets the propagation method to be used during inference.void
setQueryEvidenceMode(QueryEvidenceMode value)
Determines whether evidence is retracted for each query.void
setTerminalTime(Integer value)
Sets the terminal time, which is the time at which any terminal nodes in a Dynamic Bayesian Network connect to temporal nodes.
-
-
-
Method Detail
-
getLogLikelihood
boolean getLogLikelihood()
Gets a value indicating whether the log-likelihood of a case should be calculated in a call toInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput)
. If calculated the result can be obtained fromQueryOutput.getLogLikelihood()
.This should only be requested if required.
The natural log (base e) is calculated.
- Returns:
true
if the log-likelihood should be calculated; otherwise,false
. Defaults to false.
-
setLogLikelihood
void setLogLikelihood(boolean value)
Sets a value indicating whether the log-likelihood of a case should be calculated in a call toInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput)
. If calculated the result can be obtained fromQueryOutput.getLogLikelihood()
.This should only be requested if required.
The natural log (base e) is calculated.
- Parameters:
value
-true
if the log-likelihood should be calculated; otherwise,false
. Defaults to false.
-
getPropagation
PropagationMethod getPropagation()
Gets the propagation method to be used during inference. Default isPropagationMethod.SUM
.
-
setPropagation
void setPropagation(PropagationMethod value)
Sets the propagation method to be used during inference. Default isPropagationMethod.SUM
.
-
getDecisionAlgorithm
DecisionAlgorithm getDecisionAlgorithm()
Gets the algorithm to use when a network contains Decision nodes.
-
setDecisionAlgorithm
void setDecisionAlgorithm(DecisionAlgorithm value)
Sets the algorithm to use when a network contains Decision nodes.
-
getConflict
boolean getConflict()
Gets a value indicating whether the conflict measure should be calculated in a call toInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput)
. If calculated the result can be obtained fromQueryOutput.getConflict()
.Conflict is a measure that detects evidence that is conflicting or rare. The greater the conflict value above zero, the more likely the evidence is in conflict, or rare.
Conflict = log((P(e1)P(e2)...P(ei)) / P(e)), where P(e1), P(e2) etc... are the likelihoods of each variable considered in isolation, and P(e) is the likelihood of the all the evidence together.
-
setConflict
void setConflict(boolean value)
Sets a value indicating whether the conflict measure should be calculated in a call toInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput)
. If calculated the result can be obtained fromQueryOutput.getConflict()
.Conflict is a measure that detects evidence that is conflicting or rare. The greater the conflict value above zero, the more likely the evidence is in conflict, or rare.
Conflict = log((P(e1)P(e2)...P(ei)) / P(e)), where P(e1), P(e2) etc... are the likelihoods of each variable considered in isolation, and P(e) is the likelihood of the all the evidence together.
-
getQueryEvidenceMode
QueryEvidenceMode getQueryEvidenceMode()
Determines whether evidence is retracted for each query. SeeQueryEvidenceMode
for more information.
-
setQueryEvidenceMode
void setQueryEvidenceMode(QueryEvidenceMode value)
Determines whether evidence is retracted for each query. SeeQueryEvidenceMode
for more information.
-
getInconsistentEvidenceMode
InconsistentEvidenceMode getInconsistentEvidenceMode()
Determines when anInconsistentEvidenceException
is raised.
-
setInconsistentEvidenceMode
void setInconsistentEvidenceMode(InconsistentEvidenceMode value)
Determines when anInconsistentEvidenceException
is raised.
-
getCancellation
Cancellation getCancellation()
Allows cancellation of a query. When cancelled, aCancellationException
will be raised.If
Cancellation.getCancel()
has been set to true, it should be reset to false, before a subsequent query.
-
setCancellation
void setCancellation(Cancellation value)
Allows cancellation of a query. When cancelled, aCancellationException
will be raised.If
Cancellation.getCancel()
has been set to true, it should be reset to false, before a subsequent query.
-
getTerminalTime
Integer getTerminalTime()
Gets the terminal time, which is the time at which any terminal nodes in a Dynamic Bayesian Network connect to temporal nodes.
-
setTerminalTime
void setTerminalTime(Integer value)
Sets the terminal time, which is the time at which any terminal nodes in a Dynamic Bayesian Network connect to temporal nodes.
-
getCausalEffectKind
CausalEffectKind getCausalEffectKind()
Gets the kind of effect to calculate. e.g. Total/Direct. Not all algorithms support direct effect calculations.
-
setCausalEffectKind
void setCausalEffectKind(CausalEffectKind value)
Sets the kind of effect to calculate. e.g. Total/Direct. Not all algorithms support direct effect calculations.
-
getCausalInferenceFactory
InferenceFactory getCausalInferenceFactory()
Factory that can create inference engines, used by estimation (adjustment) algorithms to perform queries on the Bayesian network.
-
setCausalInferenceFactory
void setCausalInferenceFactory(InferenceFactory value)
Factory that can create inference engines, used by estimation (adjustment) algorithms to perform queries on the Bayesian network.
-
-