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.
docstr: Returns the mean and marginal effects at the `data_predict` points.
  
  Parameters
  ----------
  data_predict : array_like, optional
      Points at which to return the mean and marginal effects.  If not
      given, ``data_predict == exog``.
  
  Returns
  -------
  mean : ndarray
      The regression result for the mean (i.e. the actual curve).
  mfx : ndarray
      The marginal effects, i.e. the partial derivatives of the mean.
code: def fit(self, data_predict=None):
      """
      Returns the mean and marginal effects at the `data_predict` points.
  
      Parameters
      ----------
      data_predict : array_like, optional
          Points at which to return the mean and marginal effects.  If not
          given, ``data_predict == exog``.
  
      Returns
      -------
      mean : ndarray
          The regression result for the mean (i.e. the actual curve).
      mfx : ndarray
          The marginal effects, i.e. the partial derivatives of the mean.
      """
      func = self.est[self.reg_type]
      if data_predict is None:
          data_predict = self.exog
      else:
          data_predict = _adjust_shape(data_predict, self.k_vars)
  
      N_data_predict = np.shape(data_predict)[0]
      mean = np.empty((N_data_predict,))
      mfx = np.empty((N_data_predict, self.k_vars))
      for i in range(N_data_predict):
          mean_mfx = func(
              self.bw,
              self.endog,
              self.exog,
              data_predict=data_predict[i, :],
          )
          mean[i] = np.squeeze(mean_mfx[0])
          mfx_c = np.squeeze(mean_mfx[1])
          mfx[i, :] = mfx_c
  
      return mean, mfx
  
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 8 for calling the KernelReg obj's underlying member method code with example usage: obj.fit(data_predict) and returns: mean,  mfx