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
ConstructorDescriptionPC
(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.void
Learns the structure of a certain PGM.void
Learn the local structure of a certain node of a PGM.void
Learns the local structure of certain nodes of a PGM.Finds the skeleton and separation sets of the given PGM.void
orientRemainingUndirectedEdges
(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:StructureLearningAlgorithm
Returns a unique identifier for the structure learning algorithm.- Specified by:
getIdentifier
in interfaceStructureLearningAlgorithm
- Returns:
- unique identifier for the structure learning algorithm
-
getParametersAlgorithm
Description copied from interface:StructureLearningAlgorithm
Returns the parameters that are used by the algorithm.- Specified by:
getParametersAlgorithm
in interfaceStructureLearningAlgorithm
- Returns:
- a
Map
with the parameters used by the algorithm
-
learn
Description copied from interface:StructureLearningAlgorithm
Learns the local structure of certain nodes of a PGM.- Specified by:
learn
in 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:StructureLearningAlgorithm
Learns the structure of a certain PGM.- Specified by:
learn
in interfaceStructureLearningAlgorithm
- Parameters:
pgm
- a probabilistic graphical model- Throws:
ErroneousValueException
- if a parameter provided is invalid for the requested task
-
learn
Description copied from interface:StructureLearningAlgorithm
Learn the local structure of a certain node of a PGM.- Specified by:
learn
in 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
-