class_docstr: Calculate summary value of a time series.
  
  For :term:`univariate time series` a combination of summary functions and
  quantiles of the input series are calculated. If the input is a
  :term:`multivariate time series` then the summary functions and quantiles
  are calculated separately for each column.
  
  Parameters
  ----------
  summary_function : str, list, tuple, or None, default=("mean", "std", "min", "max")
      If not None, a string, or list or tuple of strings indicating the pandas
      summary functions that are used to summarize each column of the dataset.
      Must be one of ("mean", "min", "max", "median", "sum", "skew", "kurt",
      "var", "std", "mad", "sem", "nunique", "count").
      If None, no summaries are calculated, and quantiles must be non-None.
  quantiles : str, list, tuple or None, default=(0.1, 0.25, 0.5, 0.75, 0.9)
      Optional list of series quantiles to calculate. If None, no quantiles
      are calculated, and summary_function must be non-None.
  flatten_transform_index : bool, optional (default=True)
      if True, columns of return DataFrame are flat, by "variablename__feature"
      if False, columns are MultiIndex (variablename__feature)
      has no effect if return mtype is one without column names
  
  See Also
  --------
  WindowSummarizer:
      Extracting features across (shifted) windows from series
  
  Notes
  -----
  This provides a wrapper around pandas DataFrame and Series agg and
  quantile methods.
  
  Examples
  --------
  >>> from sktime.transformations.series.summarize import SummaryTransformer
  >>> from sktime.datasets import load_airline
  >>> y = load_airline()
  >>> transformer = SummaryTransformer()
  >>> y_mean = transformer.fit_transform(y)
docstr: Transform X and return a transformed version.
  
  private _transform containing the core logic, called from transform
  
  Parameters
  ----------
  X : pd.Series or pd.DataFrame
      Data to be transformed
  y : ignored argument for interface compatibility
      Additional data, e.g., labels for transformation
  
  Returns
  -------
  summary_value : scalar or pd.Series
      If `series_or_df` is univariate then a scalar is returned. Otherwise,
      a pd.Series is returned.
docstr_tok: ["Transform","X","and","return","a","transformed","version",".","private","_transform","containing","the","core","logic",",","called","from","transform","Parameters","--","--","--","--","--","X",":","pd.Series","or","pd.DataFrame","Data","to","be","transformed","y",":","ignored","argument","for","interface","compatibility","Additional","data",",","e.g.",",","labels","for","transformation","Returns","--","--","--","-","summary_value",":","scalar","or","pd.Series","If","`","series_or_df","`","is","univariate","then","a","scalar","is","returned",".","Otherwise",",","a","pd.Series","is","returned","."]
code: def _transform(self, X, y=None):
      """Transform X and return a transformed version.
  
      private _transform containing the core logic, called from transform
  
      Parameters
      ----------
      X : pd.Series or pd.DataFrame
          Data to be transformed
      y : ignored argument for interface compatibility
          Additional data, e.g., labels for transformation
  
      Returns
      -------
      summary_value : scalar or pd.Series
          If `series_or_df` is univariate then a scalar is returned. Otherwise,
          a pd.Series is returned.
      """
      if self.summary_function is None and self.quantiles is None:
          raise ValueError(
              "One of `summary_function` and `quantiles` must not be None."
          )
      summary_function = _check_summary_function(self.summary_function)
      quantiles = _check_quantiles(self.quantiles)
  
      if summary_function is not None:
          # pandas has deprecated "mad"
          # so we need to replicate the functionality here
          if "mad" in summary_function:
              mad_value = (X - X.mean()).abs().mean()
              mad_value = type(X)(mad_value)
              if isinstance(X, pd.DataFrame):
                  mad_value = mad_value.T
              mad_value.index = ["mad"]
              non_mad = set(summary_function).difference(["mad"])
              non_mad = list(non_mad)
          else:
              non_mad = summary_function
          if len(non_mad) > 0:
              summary_value = X.agg(non_mad)
              if "mad" in summary_function:
                  summary_value = pd.concat([summary_value, mad_value])
                  summary_value = summary_value.loc[
                      list(summary_function)
                  ]
          else:
              summary_value = mad_value
  
      if quantiles is not None:
          quantile_value = X.quantile(quantiles)
          quantile_value.index = [str(s) for s in quantile_value.index]
  
      if summary_function is not None and quantiles is not None:
          summary_value = pd.concat([summary_value, quantile_value])
      elif summary_function is None:
          summary_value = quantile_value
  
      if isinstance(X, pd.Series):
          summary_value.name = X.name
          summary_value = pd.DataFrame(summary_value)
  
      Xt = summary_value.T
  
      if len(Xt) > 1:
          # move the row index as second level to column
          Xt = pd.DataFrame(Xt.T.unstack()).T
          if self.flatten_transform_index:
              Xt.columns = flatten_multiindex(Xt.columns)
  
      return Xt
  
imports: import pandas
  from joblib import Parallel, delayed
  from sktime.split import ExpandingWindowSplitter, SlidingWindowSplitter
  from sktime.transformations.base import BaseTransformer
  from sktime.utils.multiindex import flatten_multiindex
label_desc: Use image node_id 2 for calling the SummaryTransformer obj's underlying member method code with example usage: obj._transform(X, y) and returns: Xt