class_docstr: Implements the MMHC hybrid structure estimation procedure for
  learning BayesianNetworks from discrete data.
  
  Parameters
  ----------
  data: pandas DataFrame object
      dataframe object where each column represents one variable.
      (If some values in the data are missing the data cells should be set to `numpy.NaN`.
      Note that pandas converts each column containing `numpy.NaN`s to dtype `float`.)
  
  state_names: dict (optional)
      A dict indicating, for each variable, the discrete set of states (or values)
      that the variable can take. If unspecified, the observed values in the data set
      are taken to be the only possible states.
  
  References
  ----------
  Tsamardinos et al., The max-min hill-climbing Bayesian network structure learning algorithm (2005)
  http://www.dsl-lab.org/supplements/mmhc_paper/paper_online.pdf
class_docstr_tok: ["Implements","the","MMHC","hybrid","structure","estimation","procedure","for","learning","BayesianNetworks","from","discrete","data",".","Parameters","--","--","--","--","--","data",":","pandas","DataFrame","object","dataframe","object","where","each","column","represents","one","variable",".","(","If","some","values","in","the","data","are","missing","the","data","cells","should","be","set","to","`","numpy.NaN","`",".","Note","that","pandas","converts","each","column","containing","`","numpy.NaN","`","s","to","dtype","`","float","`",".",")","state_names",":","dict","(","optional",")","A","dict","indicating",",","for","each","variable",",","the","discrete","set","of","states","(","or","values",")","that","the","variable","can","take",".","If","unspecified",",","the","observed","values","in","the","data","set","are","taken","to","be","the","only","possible","states",".","References","--","--","--","--","--","Tsamardinos","et","al.",",","The","max-min","hill-climbing","Bayesian","network","structure","learning","algorithm","(","2005",")","http",":","\/\/www.dsl-lab.org\/supplements\/mmhc_paper\/paper_online.pdf"]
docstr: Estimates a BayesianNetwork for the data set, using MMHC. First estimates a
  graph skeleton using MMPC and then orients the edges using score-based local
  search (hill climbing).
  
  Parameters
  ----------
  significance_level: float, default: 0.01
      The significance level to use for conditional independence tests in the data set. See `mmpc`-method.
  
  scoring_method: instance of a Scoring method (default: BDeuScore)
      The method to use for scoring during Hill Climb Search. Can be an instance of any of the
      scoring methods implemented in pgmpy.
  
  tabu_length: int
      If provided, the last `tabu_length` graph modifications cannot be reversed
      during the search procedure. This serves to enforce a wider exploration
      of the search space. Default value: 100.
  
  Returns
  -------
  Estimated model: pgmpy.base.DAG
      The estimated model without the parameterization.
  
  References
  ----------
  Tsamardinos et al., The max-min hill-climbing Bayesian network structure learning algorithm (2005),
  Algorithm 3
  http://www.dsl-lab.org/supplements/mmhc_paper/paper_online.pdf
  
  Examples
  --------
  >>> import pandas as pd
  >>> import numpy as np
  >>> from pgmpy.estimators import MmhcEstimator
  >>> data = pd.DataFrame(np.random.randint(0, 2, size=(2500, 4)), columns=list('XYZW'))
  >>> data['sum'] = data.sum(axis=1)
  >>> est = MmhcEstimator(data)
  >>> model = est.estimate()
  >>> print(model.edges())
  [('Z', 'sum'), ('X', 'sum'), ('W', 'sum'), ('Y', 'sum')]
docstr_tok: ["Estimates","a","BayesianNetwork","for","the","data","set",",","using","MMHC",".","First","estimates","a","graph","skeleton","using","MMPC","and","then","orients","the","edges","using","score-based","local","search","(","hill","climbing",")",".","Parameters","--","--","--","--","--","significance_level",":","float",",","default",":","0.01","The","significance","level","to","use","for","conditional","independence","tests","in","the","data","set",".","See","`","mmpc","`","-method",".","scoring_method",":","instance","of","a","Scoring","method","(","default",":","BDeuScore",")","The","method","to","use","for","scoring","during","Hill","Climb","Search",".","Can","be","an","instance","of","any","of","the","scoring","methods","implemented","in","pgmpy",".","tabu_length",":","int","If","provided",",","the","last","`","tabu_length","`","graph","modifications","can","not","be","reversed","during","the","search","procedure",".","This","serves","to","enforce","a","wider","exploration","of","the","search","space",".","Default","value",":","100",".","Returns","--","--","--","-","Estimated","model",":","pgmpy.base.DAG","The","estimated","model","without","the","parameterization",".","References","--","--","--","--","--","Tsamardinos","et","al.",",","The","max-min","hill-climbing","Bayesian","network","structure","learning","algorithm","(","2005",")",",","Algorithm","3","http",":","\/\/www.dsl-lab.org\/supplements\/mmhc_paper\/paper_online.pdf","Examples","--","--","--","--",">",">",">","import","pandas","as","pd",">",">",">","import","numpy","as","np",">",">",">","from","pgmpy.estimators","import","MmhcEstimator",">",">",">","data","=","pd.DataFrame","(","np.random.randint","(","0",",","2",",","size=","(","2500",",","4",")",")",",","columns=list","(","'XYZW","'",")",")",">",">",">","data","[","'sum","'","]","=","data.sum","(","axis=1",")",">",">",">","est","=","MmhcEstimator","(","data",")",">",">",">","model","=","est.estimate","(",")",">",">",">","print","(","model.edges","(",")",")","[","(","'","Z","'",",","'sum","'",")",",","(","'","X","'",",","'sum","'",")",",","(","'","W","'",",","'sum","'",")",",","(","'","Y","'",",","'sum","'",")","]"]
code: def estimate(
      self, scoring_method=None, tabu_length=10, significance_level=0.01
  ):
      """
      Estimates a BayesianNetwork for the data set, using MMHC. First estimates a
      graph skeleton using MMPC and then orients the edges using score-based local
      search (hill climbing).
  
      Parameters
      ----------
      significance_level: float, default: 0.01
          The significance level to use for conditional independence tests in the data set. See `mmpc`-method.
  
      scoring_method: instance of a Scoring method (default: BDeuScore)
          The method to use for scoring during Hill Climb Search. Can be an instance of any of the
          scoring methods implemented in pgmpy.
  
      tabu_length: int
          If provided, the last `tabu_length` graph modifications cannot be reversed
          during the search procedure. This serves to enforce a wider exploration
          of the search space. Default value: 100.
  
      Returns
      -------
      Estimated model: pgmpy.base.DAG
          The estimated model without the parameterization.
  
      References
      ----------
      Tsamardinos et al., The max-min hill-climbing Bayesian network structure learning algorithm (2005),
      Algorithm 3
      http://www.dsl-lab.org/supplements/mmhc_paper/paper_online.pdf
  
      Examples
      --------
      >>> import pandas as pd
      >>> import numpy as np
      >>> from pgmpy.estimators import MmhcEstimator
      >>> data = pd.DataFrame(np.random.randint(0, 2, size=(2500, 4)), columns=list('XYZW'))
      >>> data['sum'] = data.sum(axis=1)
      >>> est = MmhcEstimator(data)
      >>> model = est.estimate()
      >>> print(model.edges())
      [('Z', 'sum'), ('X', 'sum'), ('W', 'sum'), ('Y', 'sum')]
      """
      if scoring_method is None:
          scoring_method = BDeuScore(
              self.data, equivalent_sample_size=10
          )
  
      skel = self.mmpc(significance_level)
  
      hc = HillClimbSearch(self.data)
  
      model = hc.estimate(
          scoring_method=scoring_method,
          white_list=skel.to_directed().edges(),
          tabu_length=tabu_length,
      )
  
      return model
  
file_path: pgmpy/pgmpy/estimators/MmhcEstimator.py
imports: from pgmpy.base import UndirectedGraph
  from pgmpy.estimators import BDeuScore, HillClimbSearch, StructureEstimator
  from pgmpy.estimators.CITests import chi_square
  from pgmpy.independencies import IndependenceAssertion, Independencies
  from pgmpy.models import BayesianNetwork
  from pgmpy.utils.mathext import powerset
label_desc: Use image node_id 2 for calling the MmhcEstimator obj's underlying member method code with example usage: obj.estimate(scoring_method, tabu_length, significance_level) and returns: model