class_docstr: Nonparametric kernel regression class.
  
  Calculates the conditional mean ``E[y|X]`` where ``y = g(X) + e``.
  Note that the "local constant" type of regression provided here is also
  known as Nadaraya-Watson kernel regression; "local linear" is an extension
  of that which suffers less from bias issues at the edge of the support. Note
  that specifying a custom kernel works only with "local linear" kernel
  regression. For example, a custom ``tricube`` kernel yields LOESS regression.
  
  Parameters
  ----------
  endog : array_like
      This is the dependent variable.
  exog : array_like
      The training data for the independent variable(s)
      Each element in the list is a separate variable
  var_type : str
      The type of the variables, one character per variable:
  
          - c: continuous
          - u: unordered (discrete)
          - o: ordered (discrete)
  
  reg_type : {'lc', 'll'}, optional
      Type of regression estimator. 'lc' means local constant and
      'll' local Linear estimator.  Default is 'll'
  bw : str or array_like, optional
      Either a user-specified bandwidth or the method for bandwidth
      selection. If a string, valid values are 'cv_ls' (least-squares
      cross-validation) and 'aic' (AIC Hurvich bandwidth estimation).
      Default is 'cv_ls'. User specified bandwidth must have as many
      entries as the number of variables.
  ckertype : str, optional
      The kernel used for the continuous variables.
  okertype : str, optional
      The kernel used for the ordered discrete variables.
  ukertype : str, optional
      The kernel used for the unordered discrete variables.
  defaults : EstimatorSettings instance, optional
      The default values for the efficient bandwidth estimation.
  
  Attributes
  ----------
  bw : array_like
      The bandwidth parameters.
code: def __init__(
      self,
      endog,
      exog,
      var_type,
      reg_type="ll",
      bw="cv_ls",
      ckertype="gaussian",
      okertype="wangryzin",
      ukertype="aitchisonaitken",
      defaults=None,
  ):
      self.var_type = var_type
      self.data_type = var_type
      self.reg_type = reg_type
      self.ckertype = ckertype
      self.okertype = okertype
      self.ukertype = ukertype
      if not (
          self.ckertype in kernel_func
          and self.ukertype in kernel_func
          and self.okertype in kernel_func
      ):
          raise ValueError(
              "user specified kernel must be a supported "
              "kernel from statsmodels.nonparametric.kernels."
          )
  
      self.k_vars = len(self.var_type)
      self.endog = _adjust_shape(endog, 1)
      self.exog = _adjust_shape(exog, self.k_vars)
      self.data = np.column_stack((self.endog, self.exog))
      self.nobs = np.shape(self.exog)[0]
      self.est = dict(
          lc=self._est_loc_constant, ll=self._est_loc_linear
      )
      defaults = EstimatorSettings() if defaults is None else defaults
      self._set_defaults(defaults)
      if not isinstance(bw, str):
          bw = np.asarray(bw)
          if len(bw) != self.k_vars:
              raise ValueError(
                  "bw must have the same dimension as the "
                  "number of variables."
              )
      if not self.efficient:
          self.bw = self._compute_reg_bw(bw)
      else:
          self.bw = self._compute_efficient(bw)
  
imports: import copy
  import numpy
  from scipy import optimize
  from scipy.stats.mstats import mquantiles
  from ._kernel_base import GenericKDE, EstimatorSettings, gpke, LeaveOneOut, _get_type_pos, _adjust_shape, _compute_min_std_IQR, kernel_func
label_desc: Use image node_id 1 to create a new KernelReg object from inherited base classes: GenericKDE with example: obj = KernelReg(endog, exog, var_type, reg_type, bw, ckertype, okertype, ukertype, defaults)