class_docstr: Class used to compute parameters for a model using Maximum Likelihood Estimation.
  
  Parameters
  ----------
  model: A pgmpy.models.BayesianNetwork instance
  
  data: pandas DataFrame object
      DataFrame object with column names identical to the variable names of the network.
      (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
      that the variable can take. If unspecified, the observed values
      in the data set are taken to be the only possible states.
  
  Examples
  --------
  >>> import numpy as np
  >>> import pandas as pd
  >>> from pgmpy.models import BayesianNetwork
  >>> from pgmpy.estimators import MaximumLikelihoodEstimator
  >>> data = pd.DataFrame(np.random.randint(low=0, high=2, size=(1000, 5)),
  ...                       columns=['A', 'B', 'C', 'D', 'E'])
  >>> model = BayesianNetwork([('A', 'B'), ('C', 'B'), ('C', 'D'), ('B', 'E')])
  >>> estimator = MaximumLikelihoodEstimator(model, data)
class_docstr_tok: ["Class","used","to","compute","parameters","for","a","model","using","Maximum","Likelihood","Estimation",".","Parameters","--","--","--","--","--","model",":","A","pgmpy.models.BayesianNetwork","instance","data",":","pandas","DataFrame","object","DataFrame","object","with","column","names","identical","to","the","variable","names","of","the","network",".","(","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","that","the","variable","can","take",".","If","unspecified",",","the","observed","values","in","the","data","set","are","taken","to","be","the","only","possible","states",".","Examples","--","--","--","--",">",">",">","import","numpy","as","np",">",">",">","import","pandas","as","pd",">",">",">","from","pgmpy.models","import","BayesianNetwork",">",">",">","from","pgmpy.estimators","import","MaximumLikelihoodEstimator",">",">",">","data","=","pd.DataFrame","(","np.random.randint","(","low=0",",","high=2",",","size=","(","1000",",","5",")",")",",","...","columns=","[","'","A","'",",","'","B","'",",","'","C","'",",","'D","'",",","'","E","'","]",")",">",">",">","model","=","BayesianNetwork","(","[","(","'","A","'",",","'","B","'",")",",","(","'","C","'",",","'","B","'",")",",","(","'","C","'",",","'D","'",")",",","(","'","B","'",",","'","E","'",")","]",")",">",">",">","estimator","=","MaximumLikelihoodEstimator","(","model",",","data",")"]
docstr: Method to estimate the model parameters (CPDs) using Maximum Likelihood
  Estimation.
  
  Parameters
  ----------
  n_jobs: int (default: 1)
      Number of jobs to run in parallel. Default: 1 uses all the processors.
      Using n_jobs > 1 for small models might be slower.
  
  weighted: bool
      If weighted=True, the data must contain a `_weight` column specifying the
      weight of each datapoint (row). If False, assigns an equal weight to each
      datapoint.
  
  Returns
  -------
  Estimated parameters: list
      List of pgmpy.factors.discrete.TabularCPDs, one for each variable of the model
  
  Examples
  --------
  >>> import numpy as np
  >>> import pandas as pd
  >>> from pgmpy.models import BayesianNetwork
  >>> from pgmpy.estimators import MaximumLikelihoodEstimator
  >>> values = pd.DataFrame(np.random.randint(low=0, high=2, size=(1000, 4)),
  ...                       columns=['A', 'B', 'C', 'D'])
  >>> model = BayesianNetwork([('A', 'B'), ('C', 'B'), ('C', 'D')])
  >>> estimator = MaximumLikelihoodEstimator(model, values)
  >>> estimator.get_parameters()
  [<TabularCPD representing P(C:2) at 0x7f7b534251d0>,
  <TabularCPD representing P(B:2 | C:2, A:2) at 0x7f7b4dfd4da0>,
  <TabularCPD representing P(A:2) at 0x7f7b4dfd4fd0>,
  <TabularCPD representing P(D:2 | C:2) at 0x7f7b4df822b0>]
docstr_tok: ["Method","to","estimate","the","model","parameters","(","CPDs",")","using","Maximum","Likelihood","Estimation",".","Parameters","--","--","--","--","--","n_jobs",":","int","(","default",":","1",")","Number","of","jobs","to","run","in","parallel",".","Default",":","1","uses","all","the","processors",".","Using","n_jobs",">","1","for","small","models","might","be","slower",".","weighted",":","bool","If","weighted=True",",","the","data","must","contain","a","`","_weight","`","column","specifying","the","weight","of","each","datapoint","(","row",")",".","If","False",",","assigns","an","equal","weight","to","each","datapoint",".","Returns","--","--","--","-","Estimated","parameters",":","list","List","of","pgmpy.factors.discrete.TabularCPDs",",","one","for","each","variable","of","the","model","Examples","--","--","--","--",">",">",">","import","numpy","as","np",">",">",">","import","pandas","as","pd",">",">",">","from","pgmpy.models","import","BayesianNetwork",">",">",">","from","pgmpy.estimators","import","MaximumLikelihoodEstimator",">",">",">","values","=","pd.DataFrame","(","np.random.randint","(","low=0",",","high=2",",","size=","(","1000",",","4",")",")",",","...","columns=","[","'","A","'",",","'","B","'",",","'","C","'",",","'D","'","]",")",">",">",">","model","=","BayesianNetwork","(","[","(","'","A","'",",","'","B","'",")",",","(","'","C","'",",","'","B","'",")",",","(","'","C","'",",","'D","'",")","]",")",">",">",">","estimator","=","MaximumLikelihoodEstimator","(","model",",","values",")",">",">",">","estimator.get_parameters","(",")","[","<","TabularCPD","representing","P","(","C:2",")","at","0x7f7b534251d0",">",",","<","TabularCPD","representing","P","(","B:2","|","C:2",",","A:2",")","at","0x7f7b4dfd4da0",">",",","<","TabularCPD","representing","P","(","A:2",")","at","0x7f7b4dfd4fd0",">",",","<","TabularCPD","representing","P","(","D:2","|","C:2",")","at","0x7f7b4df822b0",">","]"]
code: def get_parameters(self, n_jobs=1, weighted=False):
      """
      Method to estimate the model parameters (CPDs) using Maximum Likelihood
      Estimation.
  
      Parameters
      ----------
      n_jobs: int (default: 1)
          Number of jobs to run in parallel. Default: 1 uses all the processors.
          Using n_jobs > 1 for small models might be slower.
  
      weighted: bool
          If weighted=True, the data must contain a `_weight` column specifying the
          weight of each datapoint (row). If False, assigns an equal weight to each
          datapoint.
  
      Returns
      -------
      Estimated parameters: list
          List of pgmpy.factors.discrete.TabularCPDs, one for each variable of the model
  
      Examples
      --------
      >>> import numpy as np
      >>> import pandas as pd
      >>> from pgmpy.models import BayesianNetwork
      >>> from pgmpy.estimators import MaximumLikelihoodEstimator
      >>> values = pd.DataFrame(np.random.randint(low=0, high=2, size=(1000, 4)),
      ...                       columns=['A', 'B', 'C', 'D'])
      >>> model = BayesianNetwork([('A', 'B'), ('C', 'B'), ('C', 'D')])
      >>> estimator = MaximumLikelihoodEstimator(model, values)
      >>> estimator.get_parameters()
      [<TabularCPD representing P(C:2) at 0x7f7b534251d0>,
      <TabularCPD representing P(B:2 | C:2, A:2) at 0x7f7b4dfd4da0>,
      <TabularCPD representing P(A:2) at 0x7f7b4dfd4fd0>,
      <TabularCPD representing P(D:2 | C:2) at 0x7f7b4df822b0>]
      """
  
      parameters = Parallel(n_jobs=n_jobs)(
          delayed(self.estimate_cpd)(node, weighted)
          for node in self.model.nodes()
      )
      # TODO: A hacky solution to return correct value for the chosen backend. Ref #1675
      parameters = [p.copy() for p in parameters]
  
      return parameters
  
file_path: pgmpy/pgmpy/estimators/MLE.py
imports: from itertools import chain
  import numpy
  from joblib import Parallel, delayed
  from pgmpy.estimators import ParameterEstimator
  from pgmpy.factors.discrete import TabularCPD
  from pgmpy.models import BayesianNetwork
label_desc: Use image node_id 2 for calling the MaximumLikelihoodEstimator obj's underlying member method code with example usage: obj.get_parameters(n_jobs, weighted) and returns: parameters