class_docstr: Base class for estimators in pgmpy; `ParameterEstimator`,
  `StructureEstimator` and `StructureScore` derive from this class.
  
  Parameters
  ----------
  data: pandas DataFrame object
      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.
code: def __init__(self, data=None, state_names=None):
      self.data = data
      # data can be None in the case when learning structure from
      # independence conditions. Look into PC.py.
      if self.data is not None:
          self.variables = list(data.columns.values)
  
          if not isinstance(state_names, dict):
              self.state_names = {
                  var: self._collect_state_names(var)
                  for var in self.variables
              }
          else:
              self.state_names = dict()
              for var in self.variables:
                  if var in state_names:
                      if not set(self._collect_state_names(var)) <= set(
                          state_names[var]
                      ):
                          raise ValueError(
                              f"Data contains unexpected states for variable: {var}."
                          )
                      self.state_names[var] = state_names[var]
                  else:
                      self.state_names[var] = self._collect_state_names(
                          var
                      )
  
file_path: pgmpy/pgmpy/estimators/base.py
imports: from collections import OrderedDict
  import pandas
label_desc: Use image node_id 1 to create a new BaseEstimator object from inherited base classes: object with example: obj = BaseEstimator(data, state_names)