class_docstr: Generalized Additive Models (GAM)
  
  This inherits from `GLM`.
  
  Warning: Not all inherited methods might take correctly account of the
  penalization. Not all options including offset and exposure have been
  verified yet.
  
  Parameters
  ----------
  endog : array_like
      The response variable.
  exog : array_like or None
      This explanatory variables are treated as linear. The model in this
      case is a partial linear model.
  smoother : instance of additive smoother class
      Examples of smoother instances include Bsplines or CyclicCubicSplines.
  alpha : float or list of floats
      Penalization weights for smooth terms. The length of the list needs
      to be the same as the number of smooth terms in the ``smoother``.
  family : instance of GLM family
      See GLM.
  offset : None or array_like
      See GLM.
  exposure : None or array_like
      See GLM.
  missing : 'none'
      Missing value handling is not supported in this class.
  **kwargs
      Extra keywords are used in call to the super classes.
  
  Notes
  -----
  Status: experimental. This has full unit test coverage for the core
  results with Gaussian and Poisson (without offset and exposure). Other
  options and additional results might not be correctly supported yet.
  (Binomial with counts, i.e. with n_trials, is most likely wrong in pirls.
  User specified var or freq weights are most likely also not correct for
  all results.)
class_docstr_tok: ["Generalized","Additive","Models","(","GAM",")","This","inherits","from","`","GLM","`",".","Warning",":","Not","all","inherited","methods","might","take","correctly","account","of","the","penalization",".","Not","all","options","including","offset","and","exposure","have","been","verified","yet",".","Parameters","--","--","--","--","--","endog",":","array_like","The","response","variable",".","exog",":","array_like","or","None","This","explanatory","variables","are","treated","as","linear",".","The","model","in","this","case","is","a","partial","linear","model",".","smoother",":","instance","of","additive","smoother","class","Examples","of","smoother","instances","include","Bsplines","or","CyclicCubicSplines",".","alpha",":","float","or","list","of","floats","Penalization","weights","for","smooth","terms",".","The","length","of","the","list","needs","to","be","the","same","as","the","number","of","smooth","terms","in","the","``","smoother","``",".","family",":","instance","of","GLM","family","See","GLM",".","offset",":","None","or","array_like","See","GLM",".","exposure",":","None","or","array_like","See","GLM",".","missing",":","'none'","Missing","value","handling","is","not","supported","in","this","class",".","*","*","kwargs","Extra","keywords","are","used","in","call","to","the","super","classes",".","Notes","--","--","-","Status",":","experimental",".","This","has","full","unit","test","coverage","for","the","core","results","with","Gaussian","and","Poisson","(","without","offset","and","exposure",")",".","Other","options","and","additional","results","might","not","be","correctly","supported","yet",".","(","Binomial","with","counts",",","i.e",".","with","n_trials",",","is","most","likely","wrong","in","pirls",".","User","specified","var","or","freq","weights","are","most","likely","also","not","correct","for","all","results",".",")"]
docstr: check and convert alpha to required list format
  
  Parameters
  ----------
  alpha : scalar, list or array_like
      penalization weight
  
  Returns
  -------
  alpha : list
      penalization weight, list with length equal to the number of
      smooth terms
docstr_tok: ["check","and","convert","alpha","to","required","list","format","Parameters","--","--","--","--","--","alpha",":","scalar",",","list","or","array_like","penalization","weight","Returns","--","--","--","-","alpha",":","list","penalization","weight",",","list","with","length","equal","to","the","number","of","smooth","terms"]
code: def _check_alpha(self, alpha):
      """check and convert alpha to required list format
  
      Parameters
      ----------
      alpha : scalar, list or array_like
          penalization weight
  
      Returns
      -------
      alpha : list
          penalization weight, list with length equal to the number of
          smooth terms
      """
      if not isinstance(alpha, Iterable):
          alpha = [alpha] * len(self.smoother.smoothers)
      elif not isinstance(alpha, list):
          # we want alpha to be a list
          alpha = list(alpha)
      return alpha
  
imports: from collections.abc import Iterable
  import copy
  import numpy
  from scipy import optimize
  import pandas
  import statsmodels.base.wrapper
  from statsmodels.discrete.discrete_model import Logit
  from statsmodels.genmod.generalized_linear_model import GLM, GLMResults, GLMResultsWrapper, _check_convergence
  import statsmodels.regression.linear_model
  from statsmodels.tools.sm_exceptions import PerfectSeparationError, ValueWarning
  from statsmodels.tools.decorators import cache_readonly
  from statsmodels.tools.data import _is_using_pandas
  from statsmodels.tools.linalg import matrix_sqrt
  from statsmodels.base._penalized import PenalizedMixin
  from statsmodels.gam.gam_penalties import MultivariateGamPenalty
  from statsmodels.gam.gam_cross_validation.gam_cross_validation import MultivariateGAMCVPath
  from statsmodels.gam.gam_cross_validation.cross_validators import KFold
label_desc: Use image node_id 2 for calling the GLMGam obj's underlying member method code with example usage: obj._check_alpha(alpha) and returns: alpha