class_docstr: Random interval feature extractor transform.
  
  Transformer that segments time-series into random intervals
  and subsequently extracts series-to-primitives features from each interval.
  
  n_intervals: str{'sqrt', 'log', 'random'}, int or float, optional (
  default='sqrt')
      Number of random intervals to generate, where m is length of time
      series:
      - If "log", log of m is used.
      - If "sqrt", sqrt of m is used.
      - If "random", random number of intervals is generated.
      - If int, n_intervals intervals are generated.
      - If float, int(n_intervals * m) is used with n_intervals giving the
      fraction of intervals of the
      time series length.
  
      For all arguments relative to the length of the time series,
      the generated number of intervals is
      always at least 1.
  
  features: list of functions, optional (default=None)
      Applies each function to random intervals to extract features.
      If None, the mean is extracted.
  
  random_state: : int, RandomState instance, optional (default=None)
      - If int, random_state is the seed used by the random number generator;
      - If RandomState instance, random_state is the random number generator;
      - If None, the random number generator is the RandomState instance used
      by `np.random`.
class_docstr_tok: ["Random","interval","feature","extractor","transform",".","Transformer","that","segments","time-series","into","random","intervals","and","subsequently","extracts","series-to-primitives","features","from","each","interval",".","n_intervals",":","str","{","'sqrt","'",",","'log","'",",","'random","'","}",",","int","or","float",",","optional","(","default='sqrt","'",")","Number","of","random","intervals","to","generate",",","where","m","is","length","of","time","series",":","-","If","``","log","''",",","log","of","m","is","used",".","-","If","``","sqrt","''",",","sqrt","of","m","is","used",".","-","If","``","random","''",",","random","number","of","intervals","is","generated",".","-","If","int",",","n_intervals","intervals","are","generated",".","-","If","float",",","int","(","n_intervals","*","m",")","is","used","with","n_intervals","giving","the","fraction","of","intervals","of","the","time","series","length",".","For","all","arguments","relative","to","the","length","of","the","time","series",",","the","generated","number","of","intervals","is","always","at","least","1.","features",":","list","of","functions",",","optional","(","default=None",")","Applies","each","function","to","random","intervals","to","extract","features",".","If","None",",","the","mean","is","extracted",".","random_state",":",":","int",",","RandomState","instance",",","optional","(","default=None",")","-","If","int",",","random_state","is","the","seed","used","by","the","random","number","generator",";","-","If","RandomState","instance",",","random_state","is","the","random","number","generator",";","-","If","None",",","the","random","number","generator","is","the","RandomState","instance","used","by","`","np.random","`","."]
docstr: Transform X.
  
  Transform X, segments time-series in each column into random
  intervals using interval indices generated
  during `fit` and extracts features from each interval.
  
  Parameters
  ----------
  X : nested pandas.DataFrame of shape [n_instances, n_features]
      Nested dataframe with time-series in cells.
  
  Returns
  -------
  Xt : pandas.DataFrame
    Transformed pandas DataFrame with n_instances rows and one
      column for each generated interval.
docstr_tok: ["Transform","X.","Transform","X",",","segments","time-series","in","each","column","into","random","intervals","using","interval","indices","generated","during","`","fit","`","and","extracts","features","from","each","interval",".","Parameters","--","--","--","--","--","X",":","nested","pandas.DataFrame","of","shape","[","n_instances",",","n_features","]","Nested","dataframe","with","time-series","in","cells",".","Returns","--","--","--","-","Xt",":","pandas.DataFrame","Transformed","pandas","DataFrame","with","n_instances","rows","and","one","column","for","each","generated","interval","."]
code: def _transform(self, X, y=None):
      """Transform X.
  
      Transform X, segments time-series in each column into random
      intervals using interval indices generated
      during `fit` and extracts features from each interval.
  
      Parameters
      ----------
      X : nested pandas.DataFrame of shape [n_instances, n_features]
          Nested dataframe with time-series in cells.
  
      Returns
      -------
      Xt : pandas.DataFrame
        Transformed pandas DataFrame with n_instances rows and one
          column for each generated interval.
      """
      # Check input of feature calculators, i.e list of functions to be
      # applied to time-series
      features = _check_features(self.features)
      X = convert_to(X, "numpy3D")
  
      # Check that the input is of the same shape as the one passed
      # during fit.
      if X.shape[1] != self.input_shape_[1]:
          raise ValueError(
              "Number of columns of input is different from what was seen in `fit`"
          )
      # Input validation
      # if not all([np.array_equal(fit_idx, trans_idx) for trans_idx,
      # fit_idx in zip(check_equal_index(X),
      #     raise ValueError('Indexes of input time-series are different
      #     from what was seen in `fit`')
  
      n_instances, _, _ = X.shape
      n_features = len(features)
  
      intervals = self.intervals_
      n_intervals = len(intervals)
  
      # Compute features on intervals.
      Xt = np.zeros(
          (n_instances, n_features * n_intervals)
      )  # Allocate output array
      # for transformed data
      columns = []
  
      i = 0
      drop_list = []
      for func in features:
          # TODO generalise to series-to-series functions and function kwargs
          for start, end in intervals:
              interval = X[:, :, start:end]
  
              # Try to use optimised computations over axis if possible,
              # otherwise iterate over rows.
              try:
                  Xt[:, i] = func(interval, axis=-1).squeeze()
              except TypeError as e:
                  if (
                      str(e) == f"{func.__name__}() got an unexpected "
                      f"keyword argument 'axis'"
                  ):
                      Xt[:, i] = np.apply_along_axis(
                          func, axis=2, arr=interval
                      ).squeeze()
                  else:
                      raise
              new_col_name = f"{start}_{end}_{func.__name__}"
              if new_col_name in columns:
                  drop_list += [i]
              else:
                  columns = columns + [new_col_name]
              i += 1
  
      Xt = pd.DataFrame(Xt)
      Xt = Xt.drop(columns=Xt.columns[drop_list])
      Xt.columns = columns
  
      return Xt
  
imports: import numpy
  import pandas
  from joblib import Parallel, delayed
  from sktime.datatypes import convert_to
  from sktime.transformations.base import BaseTransformer
  from sktime.transformations.panel.segment import RandomIntervalSegmenter
  from sktime.utils.pandas import df_map
label_desc: Use image node_id 3 for calling the RandomIntervalFeatureExtractor obj's underlying member method code with example usage: obj._transform(X, y) and returns: Xt