Class LikelihoodSamplingQueryOptions
- java.lang.Object
-
- com.bayesserver.inference.LikelihoodSamplingQueryOptions
-
- All Implemented Interfaces:
QueryOptions,QuerySamplingOptions
public final class LikelihoodSamplingQueryOptions extends Object implements QueryOptions, QuerySamplingOptions
Options that govern the calculations performed byInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput).
-
-
Constructor Summary
Constructors Constructor Description LikelihoodSamplingQueryOptions()Initializes a new instance of theLikelihoodSamplingQueryOptionsclass.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CancellationgetCancellation()Allows cancellation of a query.CausalEffectKindgetCausalEffectKind()Gets the kind of effect to calculate.InferenceFactorygetCausalInferenceFactory()Factory that can create inference engines, used by estimation (adjustment) algorithms to perform queries on the Bayesian network.booleangetConflict()Gets a value indicating whether the conflict measure should be calculated in a call toInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput).DecisionAlgorithmgetDecisionAlgorithm()Gets the algorithm to use when a network contains Decision nodes.InconsistentEvidenceModegetInconsistentEvidenceMode()Determines when anInconsistentEvidenceExceptionis raised.booleangetLogLikelihood()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).PropagationMethodgetPropagation()Gets the propagation method to be used during inference.QueryEvidenceModegetQueryEvidenceMode()Determines whether evidence is retracted for each query.IntegergetSampleCount()Gets a value indicating how many samples cases to generate in order to approximate the current query.IntegergetSeed()Gets an optional seed for the random number generator.IntegergetTerminalTime()Gets the terminal time, which is the time at which any terminal nodes in a Dynamic Bayesian Network connect to temporal nodes.voidsetCancellation(Cancellation value)Allows cancellation of a query.voidsetCausalEffectKind(CausalEffectKind value)Sets the kind of effect to calculate.voidsetCausalInferenceFactory(InferenceFactory value)Factory that can create inference engines, used by estimation (adjustment) algorithms to perform queries on the Bayesian network.voidsetConflict(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).voidsetDecisionAlgorithm(DecisionAlgorithm value)Sets the algorithm to use when a network contains Decision nodes.voidsetInconsistentEvidenceMode(InconsistentEvidenceMode value)Determines when anInconsistentEvidenceExceptionis raised.voidsetLogLikelihood(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).voidsetPropagation(PropagationMethod value)Sets the propagation method to be used during inference.voidsetQueryEvidenceMode(QueryEvidenceMode value)Determines whether evidence is retracted for each query.voidsetSampleCount(Integer value)Sets a value indicating how many samples cases to generate in order to approximate the current query.voidsetSeed(Integer value)Sets an optional seed for the random number generator.voidsetTerminalTime(Integer value)Sets the terminal time, which is the time at which any terminal nodes in a Dynamic Bayesian Network connect to temporal nodes.
-
-
-
Constructor Detail
-
LikelihoodSamplingQueryOptions
public LikelihoodSamplingQueryOptions()
Initializes a new instance of theLikelihoodSamplingQueryOptionsclass.
-
-
Method Detail
-
getCausalEffectKind
public CausalEffectKind getCausalEffectKind()
Gets the kind of effect to calculate. e.g. Total/Direct. Not all algorithms support direct effect calculations.- Specified by:
getCausalEffectKindin interfaceQueryOptions
-
setCausalEffectKind
public void setCausalEffectKind(CausalEffectKind value)
Sets the kind of effect to calculate. e.g. Total/Direct. Not all algorithms support direct effect calculations.- Specified by:
setCausalEffectKindin interfaceQueryOptions
-
getCausalInferenceFactory
public InferenceFactory getCausalInferenceFactory()
Factory that can create inference engines, used by estimation (adjustment) algorithms to perform queries on the Bayesian network.- Specified by:
getCausalInferenceFactoryin interfaceQueryOptions
-
setCausalInferenceFactory
public void setCausalInferenceFactory(InferenceFactory value)
Factory that can create inference engines, used by estimation (adjustment) algorithms to perform queries on the Bayesian network.- Specified by:
setCausalInferenceFactoryin interfaceQueryOptions
-
getSampleCount
public Integer getSampleCount()
Gets a value indicating how many samples cases to generate in order to approximate the current query. The higher the value, the more accurate the predictions will be, at the expense of query time.When null, the algorithm being used will decide how many samples to use.
- Specified by:
getSampleCountin interfaceQuerySamplingOptions
-
setSampleCount
public void setSampleCount(Integer value)
Sets a value indicating how many samples cases to generate in order to approximate the current query. The higher the value, the more accurate the predictions will be, at the expense of query time.When null, the algorithm being used will decide how many samples to use.
- Specified by:
setSampleCountin interfaceQuerySamplingOptions
-
getSeed
public Integer getSeed()
Gets an optional seed for the random number generator.
-
setSeed
public void setSeed(Integer value)
Sets an optional seed for the random number generator.
-
getTerminalTime
public Integer getTerminalTime()
Gets the terminal time, which is the time at which any terminal nodes in a Dynamic Bayesian Network connect to temporal nodes.- Specified by:
getTerminalTimein interfaceQueryOptions
-
setTerminalTime
public 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.- Specified by:
setTerminalTimein interfaceQueryOptions
-
getPropagation
public PropagationMethod getPropagation()
Gets the propagation method to be used during inference. Default isPropagationMethod.SUM.- Specified by:
getPropagationin interfaceQueryOptions
-
setPropagation
public void setPropagation(PropagationMethod value)
Sets the propagation method to be used during inference. Default isPropagationMethod.SUM.- Specified by:
setPropagationin interfaceQueryOptions
-
getDecisionAlgorithm
public DecisionAlgorithm getDecisionAlgorithm()
Gets the algorithm to use when a network contains Decision nodes.- Specified by:
getDecisionAlgorithmin interfaceQueryOptions
-
setDecisionAlgorithm
public void setDecisionAlgorithm(DecisionAlgorithm value)
Sets the algorithm to use when a network contains Decision nodes.- Specified by:
setDecisionAlgorithmin interfaceQueryOptions
-
getCancellation
public Cancellation getCancellation()
Allows cancellation of a query. When cancelled, aCancellationExceptionwill be raised.If
Cancellation.getCancel()has been set to true, it should be reset to false, before a subsequent query.- Specified by:
getCancellationin interfaceQueryOptions
-
setCancellation
public void setCancellation(Cancellation value)
Allows cancellation of a query. When cancelled, aCancellationExceptionwill be raised.If
Cancellation.getCancel()has been set to true, it should be reset to false, before a subsequent query.- Specified by:
setCancellationin interfaceQueryOptions
-
getLogLikelihood
public 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.
- Specified by:
getLogLikelihoodin interfaceQueryOptions- Returns:
trueif the log-likelihood should be calculated; otherwise,false. Defaults to false.
-
setLogLikelihood
public 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.
- Specified by:
setLogLikelihoodin interfaceQueryOptions- Parameters:
value-trueif the log-likelihood should be calculated; otherwise,false. Defaults to false.
-
getConflict
public 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.
- Specified by:
getConflictin interfaceQueryOptions
-
setConflict
public 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.
- Specified by:
setConflictin interfaceQueryOptions
-
getQueryEvidenceMode
public QueryEvidenceMode getQueryEvidenceMode()
Determines whether evidence is retracted for each query. SeeQueryEvidenceModefor more information.- Specified by:
getQueryEvidenceModein interfaceQueryOptions
-
setQueryEvidenceMode
public void setQueryEvidenceMode(QueryEvidenceMode value)
Determines whether evidence is retracted for each query. SeeQueryEvidenceModefor more information.- Specified by:
setQueryEvidenceModein interfaceQueryOptions
-
getInconsistentEvidenceMode
public InconsistentEvidenceMode getInconsistentEvidenceMode()
Determines when anInconsistentEvidenceExceptionis raised.- Specified by:
getInconsistentEvidenceModein interfaceQueryOptions
-
setInconsistentEvidenceMode
public void setInconsistentEvidenceMode(InconsistentEvidenceMode value)
Determines when anInconsistentEvidenceExceptionis raised.- Specified by:
setInconsistentEvidenceModein interfaceQueryOptions
-
-