Class BayesianBeliefNetwork

java.lang.Object
org.episteme.core.mathematics.discrete.DirectedWeightedGraph<String,Real>
org.episteme.core.mathematics.ml.BayesianBeliefNetwork
All Implemented Interfaces:
Graph<String>, WeightedGraph<String,Real>

public class BayesianBeliefNetwork extends DirectedWeightedGraph<String,Real>
Represents a Bayesian Belief Network (BBN). A probabilistic graphical model that represents a set of variables and their conditional dependencies via a directed acyclic graph (DAG).
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Constructor Details

    • BayesianBeliefNetwork

      public BayesianBeliefNetwork()
  • Method Details

    • addVariable

      public void addVariable(String name, String... states)
      Adds a random variable to the network.
      Parameters:
      name - Name of the variable.
      states - Possible states of the variable.
    • addDependency

      public void addDependency(String parent, String child)
      Adds a dependency between two variables.
      Parameters:
      parent - The parent variable.
      child - The child variable.
    • setCPT

      public void setCPT(String name, double... probabilities)
      Sets the Conditional Probability Table (CPT) for a variable.
      Parameters:
      name - The variable name.
      probabilities - The probabilities in a specific order corresponding to the parent states combinations.
    • query

      public Real query(String target, String targetState, Map<String,String> evidence)
      Performs exact inference using the Variable Elimination algorithm.
      Parameters:
      target - The variable to query.
      targetState - The state of interest.
      evidence - A map of observed variables and their states.
      Returns:
      The probability P(target=targetState | evidence).