class_docstr: Nonparametric censored regression.
  
  Calculates the conditional mean ``E[y|X]`` where ``y = g(X) + e``,
  where y is left-censored.  Left censored variable Y is defined as
  ``Y = min {Y', L}`` where ``L`` is the value at which ``Y`` is censored
  and ``Y'`` is the true value of the variable.
  
  Parameters
  ----------
  endog : list with one element which is array_like
      This is the dependent variable.
  exog : list
      The training data for the independent variable(s)
      Each element in the list is a separate variable
  dep_type : str
      The type of the dependent variable(s)
      c: Continuous
      u: Unordered (Discrete)
      o: Ordered (Discrete)
  reg_type : str
      Type of regression estimator
      lc: Local Constant Estimator
      ll: Local Linear Estimator
  bw : array_like
      Either a user-specified bandwidth or
      the method for bandwidth selection.
      cv_ls: cross-validation least squares
      aic: AIC Hurvich Estimator
  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.
  censor_val : float
      Value at which the dependent variable is censored
  defaults : EstimatorSettings instance, optional
      The default values for the efficient bandwidth estimation
  
  Attributes
  ----------
  bw : array_like
      The bandwidth parameters
docstr: The cross-validation function with leave-one-out
  estimator
  
  Parameters
  ----------
  bw : array_like
      Vector of bandwidth values
  func : callable function
      Returns the estimator of g(x).
      Can be either ``_est_loc_constant`` (local constant) or
      ``_est_loc_linear`` (local_linear).
  
  Returns
  -------
  L : float
      The value of the CV function
  
  Notes
  -----
  Calculates the cross-validation least-squares
  function. This function is minimized by compute_bw
  to calculate the optimal value of bw
  
  For details see p.35 in [2]
  
  .. math:: CV(h)=n^{-1}\sum_{i=1}^{n}(Y_{i}-g_{-i}(X_{i}))^{2}
  
  where :math:`g_{-i}(X_{i})` is the leave-one-out estimator of g(X)
  and :math:`h` is the vector of bandwidths
code: def cv_loo(self, bw, func):
      r"""
      The cross-validation function with leave-one-out
      estimator
  
      Parameters
      ----------
      bw : array_like
          Vector of bandwidth values
      func : callable function
          Returns the estimator of g(x).
          Can be either ``_est_loc_constant`` (local constant) or
          ``_est_loc_linear`` (local_linear).
  
      Returns
      -------
      L : float
          The value of the CV function
  
      Notes
      -----
      Calculates the cross-validation least-squares
      function. This function is minimized by compute_bw
      to calculate the optimal value of bw
  
      For details see p.35 in [2]
  
      .. math:: CV(h)=n^{-1}\sum_{i=1}^{n}(Y_{i}-g_{-i}(X_{i}))^{2}
  
      where :math:`g_{-i}(X_{i})` is the leave-one-out estimator of g(X)
      and :math:`h` is the vector of bandwidths
      """
      LOO_X = LeaveOneOut(self.exog)
      LOO_Y = LeaveOneOut(self.endog).__iter__()
      LOO_W = LeaveOneOut(self.W_in).__iter__()
      L = 0
      for ii, X_not_i in enumerate(LOO_X):
          Y = next(LOO_Y)
          w = next(LOO_W)
          G = func(
              bw,
              endog=Y,
              exog=-X_not_i,
              data_predict=-self.exog[ii, :],
              W=w,
          )[0]
          L += (self.endog[ii] - G) ** 2
  
      # Note: There might be a way to vectorize this. See p.72 in [1]
      return L / self.nobs
  
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 5 for calling the KernelCensoredReg obj's underlying member method code with example usage: obj.cv_loo(bw, func) and returns: unknown