Class BayesInference


  • public class BayesInference
    extends Object
    This class is used for all inference purposes. Currently, only P(Sample|Bayes Network) is supported. Other inference capabilities will be (hopefully) added later.
    • Constructor Detail

      • BayesInference

        public BayesInference​(int[][] Graph,
                              int[][] Data)
        Constructor for the class.
        Parameters:
        Graph - - An adjacency matrix representing the Bayesian Network
        Data - - The Data you have as a matrix. Each row is one datapoint
    • Method Detail

      • main

        public static void main​(String[] args)
      • getProbabilityOfSampleGivenBayesNetwork

        public double getProbabilityOfSampleGivenBayesNetwork​(int[] Sample)
        Calculates the P(Sample|Bayes Network). It is assumed that the Graph has been chosen by the user. Normally, it is recommended that the Graph is learnt from the Data using other classes of this de.uka.ipd.sdq.dsexplore.bayesnets plugin. But one can specify any Graph and any Data that one likes.
        Parameters:
        Sample - - The sample as an int array. The length of the Sample has to be equal to the number of variables in the Bayesian Network (this is equal to this.Graph.length)
        Returns:
        The probability P(Sample|Bayesian Network) as a double