docstr: Fit smoothing spline trying to optimize GCV.
  
  Try to find a bracketing interval for scipy.optimize.golden
  based on bracket.
  
  It is probably best to use target_df instead, as it is
  sometimes difficult to find a bracketing interval.
  
  INPUTS:
     y       -- response variable
     x       -- if None, uses self.x
     df      -- target degrees of freedom
     weights -- optional array of weights
     tol     -- (relative) tolerance for convergence
     brack   -- an initial guess at the bracketing interval
  
  OUTPUTS: None
     The smoothing spline is determined by self.coef,
     subsequent calls of __call__ will be the smoothing spline.
docstr_tok: ["Fit","smoothing","spline","trying","to","optimize","GCV",".","Try","to","find","a","bracketing","interval","for","scipy.optimize.golden","based","on","bracket",".","It","is","probably","best","to","use","target_df","instead",",","as","it","is","sometimes","difficult","to","find","a","bracketing","interval",".","INPUTS",":","y","--","response","variable","x","--","if","None",",","uses","self.x","df","--","target","degrees","of","freedom","weights","--","optional","array","of","weights","tol","--","(","relative",")","tolerance","for","convergence","brack","--","an","initial","guess","at","the","bracketing","interval","OUTPUTS",":","None","The","smoothing","spline","is","determined","by","self.coef",",","subsequent","calls","of","__call__","will","be","the","smoothing","spline","."]
code: def fit_optimize_gcv(
      self, y, x=None, weights=None, tol=1.0e-03, brack=(-100, 20)
  ):
      """
      Fit smoothing spline trying to optimize GCV.
  
      Try to find a bracketing interval for scipy.optimize.golden
      based on bracket.
  
      It is probably best to use target_df instead, as it is
      sometimes difficult to find a bracketing interval.
  
      INPUTS:
         y       -- response variable
         x       -- if None, uses self.x
         df      -- target degrees of freedom
         weights -- optional array of weights
         tol     -- (relative) tolerance for convergence
         brack   -- an initial guess at the bracketing interval
  
      OUTPUTS: None
         The smoothing spline is determined by self.coef,
         subsequent calls of __call__ will be the smoothing spline.
      """
  
      def _gcv(pen, y, x):
          self.fit(y, x=x, pen=np.exp(pen))
          a = self.gcv()
          return a
  
      a = golden(_gcv, args=(y, x), brack=brack, tol=tol)
  
imports: import numpy
  import numpy.linalg
  from scipy.linalg import solveh_banded
  from scipy.optimize import golden
  from models import _hbspline
  import warnings
label_desc: Use image node_id 8 for calling the SmoothingSpline obj's underlying member method code with example usage: obj.fit_optimize_gcv(y, x, weights, tol, brack) and returns: a