class_docstr: Clear sky transformer for solar data.
  
  This is a transformation which converts a time series from it's original
  domain into a percentage domain. The numerator at each time step in the
  transformation is the input values, the denominator is a weighted
  quantile of the time series for that particular time step. In the example
  of solar power transformations, the denominator is an approximation of the
  clear sky power, and the output of the transformation is the clearness index.
  
  The clear sky power, i.e. the denominator, is calculated on a grid containing
  each unique combination of time-of-day and day-of-year. The spacing of the
  grid depends on the frequency of the input data.
  
  The weights are defined using von-mises kernels with bandwidths chosen by the
  user.
  
  This transformation can be inaccurate at low values, in the solar example during
  early morning and late evening. Therefore, clear sky values below a threshold can
  be fixed to zero in the transformed domain. Denominator values of zero are set
  to zero in the transformed domain by default.
  
  This transformer is based on the work detailed in [1]_.
  
  Parameters
  ----------
  quantile_prob : float, default=0.95
      The probability level used to calculate the weighted quantile
  bw_diurnal : float, default=100
      The bandwidth of the diurnal kernel. This is the kappa value of the
      von mises kernel for time of day.
  bw_annual : float, default=10
      The bandwidth of the annual kernel. This is the kappa value of the
      von mises kernel for day of year.
  min_thresh : float, default=0
      The threshold of the clear sky power below which values are
      set to zero in the transformed domain.
  n_jobs : int or None, default=None
      Number of jobs to run in parallel.
      None means 1 unless in a joblib.parallel_backend context.
      -1 means using all processors.
  backend : str, default="loky"
      Specify the parallelisation backend implementation in joblib, where
      "loky" is used by default.
  
  References
  ----------
  .. [1] https://doi.org/10.1016/j.solener.2009.05.016
  
  Examples
  --------
  >>> from sktime.transformations.series.clear_sky import ClearSky  # doctest: +SKIP
  >>> from sktime.datasets import load_solar  # doctest: +SKIP
  >>> y = load_solar()  # doctest: +SKIP
  >>> transformer = ClearSky()  # doctest: +SKIP
  >>> # takes ~1min
  >>> y_trafo = transformer.fit_transform(y)  # doctest: +SKIP
class_docstr_tok: ["Clear","sky","transformer","for","solar","data",".","This","is","a","transformation","which","converts","a","time","series","from","it","'s","original","domain","into","a","percentage","domain",".","The","numerator","at","each","time","step","in","the","transformation","is","the","input","values",",","the","denominator","is","a","weighted","quantile","of","the","time","series","for","that","particular","time","step",".","In","the","example","of","solar","power","transformations",",","the","denominator","is","an","approximation","of","the","clear","sky","power",",","and","the","output","of","the","transformation","is","the","clearness","index",".","The","clear","sky","power",",","i.e",".","the","denominator",",","is","calculated","on","a","grid","containing","each","unique","combination","of","time-of-day","and","day-of-year",".","The","spacing","of","the","grid","depends","on","the","frequency","of","the","input","data",".","The","weights","are","defined","using","von-mises","kernels","with","bandwidths","chosen","by","the","user",".","This","transformation","can","be","inaccurate","at","low","values",",","in","the","solar","example","during","early","morning","and","late","evening",".","Therefore",",","clear","sky","values","below","a","threshold","can","be","fixed","to","zero","in","the","transformed","domain",".","Denominator","values","of","zero","are","set","to","zero","in","the","transformed","domain","by","default",".","This","transformer","is","based","on","the","work","detailed","in","[","1","]","_.","Parameters","--","--","--","--","--","quantile_prob",":","float",",","default=0.95","The","probability","level","used","to","calculate","the","weighted","quantile","bw_diurnal",":","float",",","default=100","The","bandwidth","of","the","diurnal","kernel",".","This","is","the","kappa","value","of","the","von","mises","kernel","for","time","of","day",".","bw_annual",":","float",",","default=10","The","bandwidth","of","the","annual","kernel",".","This","is","the","kappa","value","of","the","von","mises","kernel","for","day","of","year",".","min_thresh",":","float",",","default=0","The","threshold","of","the","clear","sky","power","below","which","values","are","set","to","zero","in","the","transformed","domain",".","n_jobs",":","int","or","None",",","default=None","Number","of","jobs","to","run","in","parallel",".","None","means","1","unless","in","a","joblib.parallel_backend","context",".","-1","means","using","all","processors",".","backend",":","str",",","default=","''","loky","''","Specify","the","parallelisation","backend","implementation","in","joblib",",","where","``","loky","''","is","used","by","default",".","References","--","--","--","--","--","..","[","1","]","https",":","\/\/doi.org\/10.1016\/j.solener.2009.05.016","Examples","--","--","--","--",">",">",">","from","sktime.transformations.series.clear_sky","import","ClearSky","#","doctest",":","+SKIP",">",">",">","from","sktime.datasets","import","load_solar","#","doctest",":","+SKIP",">",">",">","y","=","load_solar","(",")","#","doctest",":","+SKIP",">",">",">","transformer","=","ClearSky","(",")","#","doctest",":","+SKIP",">",">",">","#","takes","~1min",">",">",">","y_trafo","=","transformer.fit_transform","(","y",")","#","doctest",":","+SKIP"]
docstr: Fit transformer to X and y.
  
  private _fit containing the core logic, called from fit
  
  Parameters
  ----------
  X : Series of pd.DataFrame
      Data used to estimate the clear sky power.
  y : Ignored argument for interface compatibility.
  
  Returns
  -------
  self: reference to self
docstr_tok: ["Fit","transformer","to","X","and","y.","private","_fit","containing","the","core","logic",",","called","from","fit","Parameters","--","--","--","--","--","X",":","Series","of","pd.DataFrame","Data","used","to","estimate","the","clear","sky","power",".","y",":","Ignored","argument","for","interface","compatibility",".","Returns","--","--","--","-","self",":","reference","to","self"]
code: def _fit(self, X, y=None):
      """Fit transformer to X and y.
  
      private _fit containing the core logic, called from fit
  
      Parameters
      ----------
      X : Series of pd.DataFrame
          Data used to estimate the clear sky power.
      y : Ignored argument for interface compatibility.
  
      Returns
      -------
      self: reference to self
      """
      # check that the data is formatted correctly etc
      self.freq = _check_index(X)
      # now get grid of model
      df = pd.DataFrame(index=X.index)
      df["yday"] = df.index.dayofyear
      df["tod"] = (
          df.index.hour + df.index.minute / 60 + df.index.second / 60
      )
  
      # set up smoothing grid
      tod = pd.timedelta_range(start="0T", end="1D", freq=self.freq)[
          :-1
      ]
      tod = [
          (x.total_seconds() / (60 * 60)) for x in tod.to_pytimedelta()
      ]
      yday = pd.RangeIndex(start=1, stop=367)
      indx = pd.MultiIndex.from_product(
          [yday, tod], names=["yday", "tod"]
      )
  
      # set up parallel function and backend
      parallel = Parallel(n_jobs=self.n_jobs, backend=self.backend)
  
      def par_csp(x):
          res = _clearskypower(
              y=X,
              q=self.quantile_prob,
              tod_i=x[1],
              doy_i=x[0],
              tod_vec=df["tod"],
              doy_vec=df["yday"],
              bw_tod=self.bw_diurnal,
              bw_doy=self.bw_annual,
          )
  
          return res
  
      # calculate the csp
      csp = parallel(delayed(par_csp)(name) for name in indx)
      csp = pd.Series(csp, index=indx, dtype="float64")
      self.clearskypower = csp.sort_index()
  
      return self
  
file_path: sktime/sktime/transformations/series/clear_sky.py
imports: import numpy
  import pandas
  from joblib import Parallel, delayed
  from sktime.transformations.base import BaseTransformer
label_desc: Use image node_id 2 for calling the ClearSky obj's underlying member method code with example usage: obj._fit(X, y) and returns: self, res