class_docstr: Results class for generalized additive models, GAM.
  
  This inherits from GLMResults.
  
  Warning: some inherited methods might not correctly take account of the
  penalization
  
  GLMGamResults inherits from GLMResults
  All methods related to the loglikelihood function return the penalized
  values.
  
  Attributes
  ----------
  
  edf
      list of effective degrees of freedom for each column of the design
      matrix.
  hat_matrix_diag
      diagonal of hat matrix
  gcv
      generalized cross-validation criterion computed as
      ``gcv = scale / (1. - hat_matrix_trace / self.nobs)**2``
  cv
      cross-validation criterion computed as
      ``cv = ((resid_pearson / (1 - hat_matrix_diag))**2).sum() / nobs``
  
  Notes
  -----
  status: experimental
class_docstr_tok: ["Results","class","for","generalized","additive","models",",","GAM",".","This","inherits","from","GLMResults",".","Warning",":","some","inherited","methods","might","not","correctly","take","account","of","the","penalization","GLMGamResults","inherits","from","GLMResults","All","methods","related","to","the","loglikelihood","function","return","the","penalized","values",".","Attributes","--","--","--","--","--","edf","list","of","effective","degrees","of","freedom","for","each","column","of","the","design","matrix",".","hat_matrix_diag","diagonal","of","hat","matrix","gcv","generalized","cross-validation","criterion","computed","as","``","gcv","=","scale","\/","(","1",".","-","hat_matrix_trace","\/","self.nobs",")","*","*","2","``","cv","cross-validation","criterion","computed","as","``","cv","=","(","(","resid_pearson","\/","(","1","-","hat_matrix_diag",")",")","*","*","2",")",".sum","(",")","\/","nobs","``","Notes","--","--","-","status",":","experimental"]
docstr: Transform original explanatory variables for prediction
  
  Parameters
  ----------
  exog : array_like, optional
      The values for the linear explanatory variables.
  exog_smooth : array_like
      values for the variables in the smooth terms
  transform : bool, optional
      If transform is False, then ``exog`` is returned unchanged and
      ``x`` is ignored. It is assumed that exog contains the full
      design matrix for the predict observations.
      If transform is True, then the basis representation of the smooth
      term will be constructed from the provided ``x``.
  
  Returns
  -------
  exog_transformed : ndarray
      design matrix for the prediction
docstr_tok: ["Transform","original","explanatory","variables","for","prediction","Parameters","--","--","--","--","--","exog",":","array_like",",","optional","The","values","for","the","linear","explanatory","variables",".","exog_smooth",":","array_like","values","for","the","variables","in","the","smooth","terms","transform",":","bool",",","optional","If","transform","is","False",",","then","``","exog","``","is","returned","unchanged","and","``","x","``","is","ignored",".","It","is","assumed","that","exog","contains","the","full","design","matrix","for","the","predict","observations",".","If","transform","is","True",",","then","the","basis","representation","of","the","smooth","term","will","be","constructed","from","the","provided","``","x","``",".","Returns","--","--","--","-","exog_transformed",":","ndarray","design","matrix","for","the","prediction"]
code: def _tranform_predict_exog(
      self, exog=None, exog_smooth=None, transform=True
  ):
      """Transform original explanatory variables for prediction
  
      Parameters
      ----------
      exog : array_like, optional
          The values for the linear explanatory variables.
      exog_smooth : array_like
          values for the variables in the smooth terms
      transform : bool, optional
          If transform is False, then ``exog`` is returned unchanged and
          ``x`` is ignored. It is assumed that exog contains the full
          design matrix for the predict observations.
          If transform is True, then the basis representation of the smooth
          term will be constructed from the provided ``x``.
  
      Returns
      -------
      exog_transformed : ndarray
          design matrix for the prediction
      """
      if exog_smooth is not None:
          exog_smooth = np.asarray(exog_smooth)
      exog_index = None
      if transform is False:
          # the following allows that either or both exog are not None
          if exog_smooth is None:
              # exog could be None or array
              ex = exog
          else:
              if exog is None:
                  ex = exog_smooth
              else:
                  ex = np.column_stack((exog, exog_smooth))
      else:
          # transform exog_linear if needed
          if exog is not None and hasattr(
              self.model, "design_info_linear"
          ):
              exog, exog_index = _transform_predict_exog(
                  self.model, exog, self.model.design_info_linear
              )
  
          # create smooth basis
          if exog_smooth is not None:
              ex_smooth = self.model.smoother.transform(exog_smooth)
              if exog is None:
                  ex = ex_smooth
              else:
                  # TODO: there might be problems is exog_smooth is 1-D
                  ex = np.column_stack((exog, ex_smooth))
          else:
              ex = exog
  
      return ex, exog_index
  
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 GLMGamResults obj's underlying member method code with example usage: obj._tranform_predict_exog(exog, exog_smooth, transform) and returns: ex,  exog_index