Class BOAsampler
java.lang.Object
de.uka.ipd.sdq.dsexplore.bayesnets.samplers.BOAsampler
Used to sample data from a learnt Bayesian Network.
Algorithm description: First the root node (i.e the node having no parents) is assigned a data value according to the probability parameters encoded in the network. Then, the children of the node are assigned values (given the parent node value) using conditional probability parameters. This process continues until all nodes are assigned some value.
The whole process is repeated as many times as we want the number of offspring.
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
BOAsampler
public BOAsampler(int[][] Graph, int[][] DataMatrix) Constructor for the class.- Parameters:
Graph
- - An adjacency matrix representing the network/graphDataMatrix
- - A matrix containing the data
-
-
Method Details
-
main
-
sample
public int[][] sample(int NumberOfSamples) Method to sample solutions/offspring/data-points from the Bayesian Network.- Parameters:
NumberOfSamples
- - The number of data-points/offspring one wants from the learnt Bayesian Network.- Returns:
- A matrix containing the sampled offspring/data-points. Each row corresponds to an offspring/data-point.
-
getAllParents
Gives a list of all root nodes in the network/graph. Root nodes are those nodes which don't have any other node as its parent.- Parameters:
Graph
- - An adjacency matrix of the network/graph.- Returns:
- An ArrayList of Integer values. The integer values correspond to the indices of the root nodes.
-