Module es.upm.fi.cig.multictbnc
Class PC
java.lang.Object
es.upm.fi.cig.multictbnc.learning.structure.constraintlearning.PC.PC
- All Implemented Interfaces:
StructureLearningAlgorithm
- Direct Known Subclasses:
HITONPC,PCHybridAlgorithm
Implementation of the PC algorithm discrete-state Bayesian networks.
-
Constructor Summary
ConstructorsConstructorDescriptionPC(double significance) Constructor that initialises the PC algorithm by proving the significance level used. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean[][]buildCompleteStructure(PGM<? extends Node> pgm) Returns the adjacency matrix of a PGM with a complete structure.getEdgesPGM(PGM<? extends Node> pgm) Retrieves all possible edges between nodes of a PGM.Returns a unique identifier for the structure learning algorithm.Returns the parameters that are used by the algorithm.voidLearns the structure of a certain PGM.voidLearn the local structure of a certain node of a PGM.voidLearns the local structure of certain nodes of a PGM.Finds the skeleton and separation sets of the given PGM.voidorientRemainingUndirectedEdges(boolean[][] adjacencyMatrix) Orient the remaining undirected edges of the Bayesian network.
-
Constructor Details
-
PC
public PC(double significance) Constructor that initialises the PC algorithm by proving the significance level used.- Parameters:
significance- significance level
-
-
Method Details
-
getIdentifier
Description copied from interface:StructureLearningAlgorithmReturns a unique identifier for the structure learning algorithm.- Specified by:
getIdentifierin interfaceStructureLearningAlgorithm- Returns:
- unique identifier for the structure learning algorithm
-
getParametersAlgorithm
Description copied from interface:StructureLearningAlgorithmReturns the parameters that are used by the algorithm.- Specified by:
getParametersAlgorithmin interfaceStructureLearningAlgorithm- Returns:
- a
Mapwith the parameters used by the algorithm
-
learn
Description copied from interface:StructureLearningAlgorithmLearns the local structure of certain nodes of a PGM.- Specified by:
learnin interfaceStructureLearningAlgorithm- Parameters:
pgm- a probabilistic graphical modelidxNodes- node indexes- Throws:
ErroneousValueException- if a parameter provided is invalid for the requested task
-
learn
Description copied from interface:StructureLearningAlgorithmLearns the structure of a certain PGM.- Specified by:
learnin interfaceStructureLearningAlgorithm- Parameters:
pgm- a probabilistic graphical model- Throws:
ErroneousValueException- if a parameter provided is invalid for the requested task
-
learn
Description copied from interface:StructureLearningAlgorithmLearn the local structure of a certain node of a PGM.- Specified by:
learnin interfaceStructureLearningAlgorithm- Parameters:
pgm- a probabilistic graphical modelidxNode- node index
-
buildCompleteStructure
Returns the adjacency matrix of a PGM with a complete structure.- Parameters:
pgm- probabilistic graphical model- Returns:
- adjacency matrix
-
getEdgesPGM
Retrieves all possible edges between nodes of a PGM.- Parameters:
pgm- a probabilistic graphical model- Returns:
- list of all possible edges
-
learnSkeleton
protected Map<Integer,List<Integer>> learnSkeleton(PGM<? extends Node> pgm, boolean[][] adjacencyMatrix, List<List<Integer>> edges) throws ErroneousValueException Finds the skeleton and separation sets of the given PGM. The skeleton is saved in a given adjacency matrix, while the method returns the separation sets.- Parameters:
pgm- probabilistic graphical modeladjacencyMatrix- adjacency matrixedges- list of all possible edges- Returns:
- separating sets
- Throws:
ErroneousValueException- if a provided parameter is erroneous for the requested task
-
orientRemainingUndirectedEdges
public void orientRemainingUndirectedEdges(boolean[][] adjacencyMatrix) Orient the remaining undirected edges of the Bayesian network.- Parameters:
adjacencyMatrix- current adjacency matrix
-