java.lang.Object
es.upm.fi.cig.multictbnc.learning.structure.constraintlearning.PC.PC
All Implemented Interfaces:
StructureLearningAlgorithm
Direct Known Subclasses:
HITONPC, PCHybridAlgorithm

public class PC extends Object implements StructureLearningAlgorithm
Implementation of the PC algorithm discrete-state Bayesian networks.
  • 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

      public String getIdentifier()
      Description copied from interface: StructureLearningAlgorithm
      Returns a unique identifier for the structure learning algorithm.
      Specified by:
      getIdentifier in interface StructureLearningAlgorithm
      Returns:
      unique identifier for the structure learning algorithm
    • getParametersAlgorithm

      public Map<String,String> getParametersAlgorithm()
      Description copied from interface: StructureLearningAlgorithm
      Returns the parameters that are used by the algorithm.
      Specified by:
      getParametersAlgorithm in interface StructureLearningAlgorithm
      Returns:
      a Map with the parameters used by the algorithm
    • learn

      public void learn(PGM<? extends Node> pgm, List<Integer> idxNodes) throws ErroneousValueException
      Description copied from interface: StructureLearningAlgorithm
      Learns the local structure of certain nodes of a PGM.
      Specified by:
      learn in interface StructureLearningAlgorithm
      Parameters:
      pgm - a probabilistic graphical model
      idxNodes - node indexes
      Throws:
      ErroneousValueException - if a parameter provided is invalid for the requested task
    • learn

      public void learn(PGM<? extends Node> pgm) throws ErroneousValueException
      Description copied from interface: StructureLearningAlgorithm
      Learns the structure of a certain PGM.
      Specified by:
      learn in interface StructureLearningAlgorithm
      Parameters:
      pgm - a probabilistic graphical model
      Throws:
      ErroneousValueException - if a parameter provided is invalid for the requested task
    • learn

      public void learn(PGM<? extends Node> pgm, int idxNode)
      Description copied from interface: StructureLearningAlgorithm
      Learn the local structure of a certain node of a PGM.
      Specified by:
      learn in interface StructureLearningAlgorithm
      Parameters:
      pgm - a probabilistic graphical model
      idxNode - node index
    • buildCompleteStructure

      protected boolean[][] buildCompleteStructure(PGM<? extends Node> pgm)
      Returns the adjacency matrix of a PGM with a complete structure.
      Parameters:
      pgm - probabilistic graphical model
      Returns:
      adjacency matrix
    • getEdgesPGM

      protected List<List<Integer>> getEdgesPGM(PGM<? extends Node> pgm)
      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 model
      adjacencyMatrix - adjacency matrix
      edges - 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