inferlo.pairwise.inference.tree_dp.infer_tree_dp
- inferlo.pairwise.inference.tree_dp.infer_tree_dp(model: PairWiseFiniteModel, subtree_mp=False) InferenceResult [source]
Inference using DP on tree.
Performs dynamic programming on tree.
Applicable only if the interaction graph is a tree or a forest. Otherwise throws exception.
- Parameters:
model – Model for which to perform inference.
subtree_mp – If true, will return marginal probabilities for subtrees, i.e. for each node will return probability of it having different values if we leave only it and its subtree.
- Returns:
InferenceResult object.