class_docstr: Class for representing PDAGs (also known as CPDAG). PDAGs are the equivalence classes of
  DAGs and contain both directed and undirected edges.
  
  Note: In this class, undirected edges are represented using two edges in both direction i.e.
  an undirected edge between X - Y is represented using X -> Y and X <- Y.
class_docstr_tok: ["Class","for","representing","PDAGs","(","also","known","as","CPDAG",")",".","PDAGs","are","the","equivalence","classes","of","DAGs","and","contain","both","directed","and","undirected","edges",".","Note",":","In","this","class",",","undirected","edges","are","represented","using","two","edges","in","both","direction","i.e",".","an","undirected","edge","between","X","-","Y","is","represented","using","X","-",">","Y","and","X","<","-","Y","."]
docstr: Initializes a PDAG class.
  
  Parameters
  ----------
  directed_ebunch: list, array-like of 2-tuples
      List of directed edges in the PDAG.
  
  undirected_ebunch: list, array-like of 2-tuples
      List of undirected edges in the PDAG.
  
  latents: list, array-like
      List of nodes which are latent variables.
  
  Returns
  -------
  An instance of the PDAG object.
  
  Examples
  --------
docstr_tok: ["Initializes","a","PDAG","class",".","Parameters","--","--","--","--","--","directed_ebunch",":","list",",","array-like","of","2-tuples","List","of","directed","edges","in","the","PDAG",".","undirected_ebunch",":","list",",","array-like","of","2-tuples","List","of","undirected","edges","in","the","PDAG",".","latents",":","list",",","array-like","List","of","nodes","which","are","latent","variables",".","Returns","--","--","--","-","An","instance","of","the","PDAG","object",".","Examples","--","--","--","--"]
code: def __init__(
      self, directed_ebunch=[], undirected_ebunch=[], latents=[]
  ):
      """
      Initializes a PDAG class.
  
      Parameters
      ----------
      directed_ebunch: list, array-like of 2-tuples
          List of directed edges in the PDAG.
  
      undirected_ebunch: list, array-like of 2-tuples
          List of undirected edges in the PDAG.
  
      latents: list, array-like
          List of nodes which are latent variables.
  
      Returns
      -------
      An instance of the PDAG object.
  
      Examples
      --------
      """
      super(PDAG, self).__init__(
          directed_ebunch
          + undirected_ebunch
          + [(Y, X) for (X, Y) in undirected_ebunch]
      )
      self.latents = set(latents)
      self.directed_edges = set(directed_ebunch)
      self.undirected_edges = set(undirected_ebunch)
  
imports: import itertools
  import networkx
  import numpy
  from pgmpy.base import UndirectedGraph
  from pgmpy.global_vars import logger
  from pgmpy.independencies import Independencies
label_desc: Use image node_id 1 to create a new PDAG object from inherited base classes: nx with example: obj = PDAG(directed_ebunch, undirected_ebunch, latents)