Interface QueryDistributionCollection
-
- All Superinterfaces:
Collection<QueryDistribution>
,Iterable<QueryDistribution>
,List<QueryDistribution>
- All Known Implementing Classes:
DefaultQueryDistributionCollection
public interface QueryDistributionCollection extends List<QueryDistribution>
The collection of distributions to be calculated by aInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput)
. Only request those that you need. If required, a distribution collection can be dynamically attached or detached from aninference engine
. Also note that individual elements can be enabled or disabled on a per query basis.Each distribution added, such as a
Table
, acts like a buffer. I.e. the values are populated by theInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput)
method. This means that the same distributions can be re-used across multiple calls toInference.query(com.bayesserver.inference.QueryOptions, com.bayesserver.inference.QueryOutput)
, without the need to recreate the distribution each time.It is important not to request distributions you do not need, because the computations will take longer. For example, it is common to request all marginal probabilities, P(A), P(B), P(C), ... , P(Z) given the
evidence
, however if you only need to know P(A) and P(B) given theevidence
, then limit the query to just these distributions.Typically the distributions requested are a number of marginal probabilities, such as P(A), P(B), P(C) etc... given the
evidence
, however it is also possible to request distributions over more than one variable, so we might query P(A), P(B,C) given theevidence
.If you are performing a batch of queries, there is no need to remove distributions that happen to have evidence set for a particular query.
For Dynamic Bayesian networks, times can be associated with distribution variables, to predict values in the future, present or past.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description QueryDistribution
add(Distribution distribution)
Adds the specified distribution, automatically creating aQueryDistribution
instance.-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
-
-
-
-
Method Detail
-
add
QueryDistribution add(Distribution distribution)
Adds the specified distribution, automatically creating aQueryDistribution
instance.- Parameters:
distribution
- The distribution to query.- Returns:
- The automatically created
QueryDistribution
instance.
-
-