class_docstr: Mixin class for Maximum Penalized Likelihood
  
  Parameters
  ----------
  args and kwds for the model super class
  penal : None or instance of Penalized function class
      If penal is None, then NonePenalty is used.
  pen_weight : float or None
      factor for weighting the penalization term.
      If None, then pen_weight is set to nobs.
  
  
  TODO: missing **kwds or explicit keywords
  
  TODO: do we adjust the inherited docstrings?
  We would need templating to add the penalization parameters
code: def __init__(self, *args, **kwds):
      # pop extra kwds before calling super
      self.penal = kwds.pop("penal", None)
      self.pen_weight = kwds.pop("pen_weight", None)
  
      super().__init__(*args, **kwds)
  
      # TODO: define pen_weight as average pen_weight? i.e. per observation
      # I would have prefered len(self.endog) * kwds.get('pen_weight', 1)
      # or use pen_weight_factor in signature
      if self.pen_weight is None:
          self.pen_weight = len(self.endog)
  
      if self.penal is None:
          # unpenalized by default
          self.penal = NonePenalty()
          self.pen_weight = 0
  
      self._init_keys.extend(["penal", "pen_weight"])
      self._null_drop_keys = getattr(self, "_null_drop_keys", [])
      self._null_drop_keys.extend(["penal", "pen_weight"])
  
file_path: statsmodels/statsmodels/base/_penalized.py
imports: import numpy
  from ._penalties import NonePenalty
  from statsmodels.tools.numdiff import approx_fprime_cs, approx_fprime
label_desc: Use image node_id 1 to create a new PenalizedMixin object  with example: obj = PenalizedMixin()