Class BOAsampler
- java.lang.Object
-
- de.uka.ipd.sdq.dsexplore.bayesnets.samplers.BOAsampler
-
public class BOAsampler extends Object
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
Constructors Constructor Description BOAsampler(int[][] Graph, int[][] DataMatrix)
Constructor for the class.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ArrayList<Integer>
getAllParents(int[][] Graph)
Gives a list of all root nodes in the network/graph.static void
main(String[] args)
int[][]
sample(int NumberOfSamples)
Method to sample solutions/offspring/data-points from the Bayesian Network.
-
-
-
Method Detail
-
main
public static void main(String[] args)
-
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
public ArrayList<Integer> getAllParents(int[][] Graph)
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.
-
-