class_docstr: Canonical Time-series Characteristics (Catch22).
  
  Overview: Input n series with d dimensions of length m
  Transforms series into the 22 Catch22 [1]_ features extracted from the hctsa [2]_
  toolbox.
  
  Parameters
  ----------
  features : int/str or List of int/str, optional, default="all"
      The Catch22 features to extract by feature index, feature name as a str or as a
      list of names or indices for multiple features. If "all", all features are
      extracted.
      Valid features are as follows:
          ["DN_HistogramMode_5", "DN_HistogramMode_10",
          "SB_BinaryStats_diff_longstretch0", "DN_OutlierInclude_p_001_mdrmd",
          "DN_OutlierInclude_n_001_mdrmd", "CO_f1ecac", "CO_FirstMin_ac",
          "SP_Summaries_welch_rect_area_5_1", "SP_Summaries_welch_rect_centroid",
          "FC_LocalSimple_mean3_stderr", "CO_trev_1_num", "CO_HistogramAMI_even_2_5",
          "IN_AutoMutualInfoStats_40_gaussian_fmmi", "MD_hrv_classic_pnn40",
          "SB_BinaryStats_mean_longstretch1", "SB_MotifThree_quantile_hh",
          "FC_LocalSimple_mean1_tauresrat", "CO_Embed2_Dist_tau_d_expfit_meandiff",
          "SC_FluctAnal_2_dfa_50_1_2_logi_prop_r1",
          "SC_FluctAnal_2_rsrangefit_50_1_logi_prop_r1",
          "SB_TransitionMatrix_3ac_sumdiagcov", "PD_PeriodicityWang_th0_01"]
  catch24 : bool, optional, default=False
      Extract the mean and standard deviation as well as the 22 Catch22 features if
      true. If a List of specific features to extract is provided, "Mean" and/or
      "StandardDeviation" must be added to the List to extract these features.
  outlier_norm : bool, optional, default=False
      Normalise each series during the two outlier Catch22 features, which can take a
      while to process for large values.
  replace_nans : bool, optional, default=True
      Replace NaN or inf values from the Catch22 transform with 0.
  n_jobs : int, optional, default=1
      The number of jobs to run in parallel for transform. Requires multiple input
      cases. A value of -1 uses all CPU cores.
  
  See Also
  --------
  Catch22Classifier
  
  Notes
  -----
  Original Catch22 package implementations:
  https://github.com/DynamicsAndNeuralSystems/Catch22
  
  For the Java version, see
  https://github.com/uea-machine-learning/tsml/blob/master/src/main/java
  /tsml/transformers/Catch22.java
  
  References
  ----------
  .. [1] Lubba, C. H., Sethi, S. S., Knaute, P., Schultz, S. R., Fulcher, B. D., &
  Jones, N. S. (2019). catch22: Canonical time-series characteristics. Data Mining
  and Knowledge Discovery, 33(6), 1821-1852.
  .. [2] Fulcher, B. D., Little, M. A., & Jones, N. S. (2013). Highly comparative
  time-series analysis: the empirical structure of time series and their methods.
  Journal of the Royal Society Interface, 10(83), 20130048.
class_docstr_tok: ["Canonical","Time-series","Characteristics","(","Catch22",")",".","Overview",":","Input","n","series","with","d","dimensions","of","length","m","Transforms","series","into","the","22","Catch22","[","1","]","_","features","extracted","from","the","hctsa","[","2","]","_","toolbox",".","Parameters","--","--","--","--","--","features",":","int\/str","or","List","of","int\/str",",","optional",",","default=","''","all","''","The","Catch22","features","to","extract","by","feature","index",",","feature","name","as","a","str","or","as","a","list","of","names","or","indices","for","multiple","features",".","If","``","all","''",",","all","features","are","extracted",".","Valid","features","are","as","follows",":","[","``","DN_HistogramMode_5","''",",","``","DN_HistogramMode_10","''",",","``","SB_BinaryStats_diff_longstretch0","''",",","``","DN_OutlierInclude_p_001_mdrmd","''",",","``","DN_OutlierInclude_n_001_mdrmd","''",",","``","CO_f1ecac","''",",","``","CO_FirstMin_ac","''",",","``","SP_Summaries_welch_rect_area_5_1","''",",","``","SP_Summaries_welch_rect_centroid","''",",","``","FC_LocalSimple_mean3_stderr","''",",","``","CO_trev_1_num","''",",","``","CO_HistogramAMI_even_2_5","''",",","``","IN_AutoMutualInfoStats_40_gaussian_fmmi","''",",","``","MD_hrv_classic_pnn40","''",",","``","SB_BinaryStats_mean_longstretch1","''",",","``","SB_MotifThree_quantile_hh","''",",","``","FC_LocalSimple_mean1_tauresrat","''",",","``","CO_Embed2_Dist_tau_d_expfit_meandiff","''",",","``","SC_FluctAnal_2_dfa_50_1_2_logi_prop_r1","''",",","``","SC_FluctAnal_2_rsrangefit_50_1_logi_prop_r1","''",",","``","SB_TransitionMatrix_3ac_sumdiagcov","''",",","``","PD_PeriodicityWang_th0_01","''","]","catch24",":","bool",",","optional",",","default=False","Extract","the","mean","and","standard","deviation","as","well","as","the","22","Catch22","features","if","true",".","If","a","List","of","specific","features","to","extract","is","provided",",","``","Mean","''","and\/or","``","StandardDeviation","''","must","be","added","to","the","List","to","extract","these","features",".","outlier_norm",":","bool",",","optional",",","default=False","Normalise","each","series","during","the","two","outlier","Catch22","features",",","which","can","take","a","while","to","process","for","large","values",".","replace_nans",":","bool",",","optional",",","default=True","Replace","NaN","or","inf","values","from","the","Catch22","transform","with","0.","n_jobs",":","int",",","optional",",","default=1","The","number","of","jobs","to","run","in","parallel","for","transform",".","Requires","multiple","input","cases",".","A","value","of","-1","uses","all","CPU","cores",".","See","Also","--","--","--","--","Catch22Classifier","Notes","--","--","-","Original","Catch22","package","implementations",":","https",":","\/\/github.com\/DynamicsAndNeuralSystems\/Catch22","For","the","Java","version",",","see","https",":","\/\/github.com\/uea-machine-learning\/tsml\/blob\/master\/src\/main\/java","\/tsml\/transformers\/Catch22.java","References","--","--","--","--","--","..","[","1","]","Lubba",",","C.","H.",",","Sethi",",","S.","S.",",","Knaute",",","P.",",","Schultz",",","S.","R.",",","Fulcher",",","B.","D.",",","&","Jones",",","N.","S.","(","2019",")",".","catch22",":","Canonical","time-series","characteristics",".","Data","Mining","and","Knowledge","Discovery",",","33","(","6",")",",","1821-1852",".","..","[","2","]","Fulcher",",","B.","D.",",","Little",",","M.","A.",",","&","Jones",",","N.","S.","(","2013",")",".","Highly","comparative","time-series","analysis",":","the","empirical","structure","of","time","series","and","their","methods",".","Journal","of","the","Royal","Society","Interface",",","10","(","83",")",",","20130048","."]
code: def _transform_case_single(self, series, feature, case_id, inst_idx):
      from sktime.transformations.panel._catch22_numba import (
          _ac_first_zero,
          _autocorr,
      )
  
      args = [series]
  
      if case_id is None:
          if feature == 0 or feature == 1 or feature == 11:
              smin = np.min(series)
              smax = np.max(series)
              args = [series, smin, smax]
          elif feature == 2:
              smean = np.mean(series)
              args = [series, smean]
          elif feature == 3 or feature == 4:
              if self.outlier_norm:
                  std = np.std(series)
                  if std > 0:
                      series = (series - np.mean(series)) / std
              args = [series]
          elif feature == 7 or feature == 8:
              smean = np.mean(series)
              nfft = int(
                  np.power(2, np.ceil(np.log(len(series)) / np.log(2)))
              )
              fft = np.fft.fft(series - smean, n=nfft)
              args = [series, fft]
          elif feature == 5 or feature == 6 or feature == 12:
              smean = np.mean(series)
              nfft = int(
                  np.power(2, np.ceil(np.log(len(series)) / np.log(2)))
              )
              fft = np.fft.fft(series - smean, n=nfft)
              ac = _autocorr(series, fft)
              args = [ac]
          elif feature == 16 or feature == 17 or feature == 20:
              smean = np.mean(series)
              nfft = int(
                  np.power(2, np.ceil(np.log(len(series)) / np.log(2)))
              )
              fft = np.fft.fft(series - smean, n=nfft)
              ac = _autocorr(series, fft)
              acfz = _ac_first_zero(ac)
              args = [series, acfz]
      else:
          if feature == 0 or feature == 1 or feature == 11:
              if self._smin[inst_idx] is None:
                  self._smin[inst_idx] = np.min(series)
              if self._smax[inst_idx] is None:
                  self._smax[inst_idx] = np.max(series)
              args = [
                  series,
                  self._smin[inst_idx],
                  self._smax[inst_idx],
              ]
          elif feature == 2:
              if self._smean[inst_idx] is None:
                  self._smean[inst_idx] = np.mean(series)
              args = [series, self._smean[inst_idx]]
          elif feature == 3 or feature == 4:
              if self.outlier_norm:
                  if self._outlier_series[inst_idx] is None:
                      std = np.std(series)
                      if std > 0:
                          self._outlier_series[inst_idx] = (
                              series - np.mean(series)
                          ) / std
                      else:
                          self._outlier_series[inst_idx] = series
                  series = self._outlier_series[inst_idx]
              args = [series]
          elif feature == 7 or feature == 8:
              if self._smean[inst_idx] is None:
                  self._smean[inst_idx] = np.mean(series)
              if self._fft[inst_idx] is None:
                  nfft = int(
                      np.power(
                          2, np.ceil(np.log(len(series)) / np.log(2))
                      )
                  )
                  self._fft[inst_idx] = np.fft.fft(
                      series - self._smean[inst_idx], n=nfft
                  )
              args = [series, self._fft[inst_idx]]
          elif feature == 5 or feature == 6 or feature == 12:
              if self._smean[inst_idx] is None:
                  self._smean[inst_idx] = np.mean(series)
              if self._fft[inst_idx] is None:
                  nfft = int(
                      np.power(
                          2, np.ceil(np.log(len(series)) / np.log(2))
                      )
                  )
                  self._fft[inst_idx] = np.fft.fft(
                      series - self._smean[inst_idx], n=nfft
                  )
              if self._ac[inst_idx] is None:
                  self._ac[inst_idx] = _autocorr(
                      series, self._fft[inst_idx]
                  )
              args = [self._ac[inst_idx]]
          elif feature == 16 or feature == 17 or feature == 20:
              if self._smean[inst_idx] is None:
                  self._smean[inst_idx] = np.mean(series)
              if self._fft[inst_idx] is None:
                  nfft = int(
                      np.power(
                          2, np.ceil(np.log(len(series)) / np.log(2))
                      )
                  )
                  self._fft[inst_idx] = np.fft.fft(
                      series - self._smean[inst_idx], n=nfft
                  )
              if self._ac[inst_idx] is None:
                  self._ac[inst_idx] = _autocorr(
                      series, self._fft[inst_idx]
                  )
              if self._acfz[inst_idx] is None:
                  self._acfz[inst_idx] = _ac_first_zero(
                      self._ac[inst_idx]
                  )
              args = [series, self._acfz[inst_idx]]
  
      return self._get_feature_fun(feature)(*args)
  
file_path: sktime/sktime/transformations/panel/catch22.py
imports: import warnings
  import numpy
  import pandas
  from joblib import Parallel, delayed
  from sktime.datatypes import convert_to
  from sktime.transformations.base import BaseTransformer
  from sktime.utils.validation import check_n_jobs
label_desc: Use image node_id 6 for calling the Catch22 obj's underlying member method code with example usage: obj._transform_case_single(series, feature, case_id, inst_idx) and returns: self