class_docstr: Class for Bayesian structure scoring for BayesianNetworks with Dirichlet priors.
  The BDeu score is the result of setting all Dirichlet hyperparameters/pseudo_counts to
  `equivalent_sample_size/variable_cardinality`.
  The `score`-method measures how well a model is able to describe the given data set.
  
  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`.)
  
  equivalent_sample_size: int (default: 10)
      The equivalent/imaginary sample size (of uniform pseudo samples) for the dirichlet hyperparameters.
      The score is sensitive to this value, runs with different values might be useful.
  
  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
  ---------
  [1] Koller & Friedman, Probabilistic Graphical Models - Principles and Techniques, 2009
  Section 18.3.4-18.3.6 (esp. page 806)
  [2] AM Carvalho, Scoring functions for learning Bayesian networks,
  http://www.lx.it.pt/~asmc/pub/talks/09-TA/ta_pres.pdf
class_docstr_tok: ["Class","for","Bayesian","structure","scoring","for","BayesianNetworks","with","Dirichlet","priors",".","The","BDeu","score","is","the","result","of","setting","all","Dirichlet","hyperparameters\/pseudo_counts","to","`","equivalent_sample_size\/variable_cardinality","`",".","The","`","score","`","-method","measures","how","well","a","model","is","able","to","describe","the","given","data","set",".","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","`",".",")","equivalent_sample_size",":","int","(","default",":","10",")","The","equivalent\/imaginary","sample","size","(","of","uniform","pseudo","samples",")","for","the","dirichlet","hyperparameters",".","The","score","is","sensitive","to","this","value",",","runs","with","different","values","might","be","useful",".","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","--","--","--","--","-","[","1","]","Koller","&","Friedman",",","Probabilistic","Graphical","Models","-","Principles","and","Techniques",",","2009","Section","18.3.4-18.3.6","(","esp",".","page","806",")","[","2","]","AM","Carvalho",",","Scoring","functions","for","learning","Bayesian","networks",",","http",":","\/\/www.lx.it.pt\/~asmc\/pub\/talks\/09-TA\/ta_pres.pdf"]
code: def __init__(self, data, equivalent_sample_size=10, **kwargs):
      self.equivalent_sample_size = equivalent_sample_size
      super(BDeuScore, self).__init__(data, **kwargs)
  
imports: from math import lgamma, log
  import numpy
  from scipy.special import gammaln
  from pgmpy.estimators import BaseEstimator
label_desc: Use image node_id 1 to create a new BDeuScore object from inherited base classes: StructureScore with example: obj = BDeuScore(data, equivalent_sample_size)