class_docstr: Piecewise Aggregate Approximation (PAA) transformation.
  
  PAA was originally presented in [1]_.
  
  Parameters
  ----------
  n_segments : int (default: 1)
      Number of PAA segments to compute
  
  Notes
  -----
      This method requires a dataset of equal-sized time series.
  
  Examples
  --------
  >>> paa = PiecewiseAggregateApproximation(n_segments=3)
  >>> data = [[-1., 2., 0.1, -1., 1., -1.], [1., 3.2, -1., -3., 1., -1.]]
  >>> paa_data = paa.fit_transform(data)
  >>> paa_data.shape
  (2, 3, 1)
  >>> paa_data
  array([[[ 0.5 ],
          [-0.45],
          [ 0.  ]],
  <BLANKLINE>
         [[ 2.1 ],
          [-2.  ],
          [ 0.  ]]])
  >>> paa.distance_paa(paa_data[0], paa_data[1])  # doctest: +ELLIPSIS
  3.15039...
  >>> paa.distance(data[0], data[1])  # doctest: +ELLIPSIS
  3.15039...
  >>> paa.inverse_transform(paa_data)
  array([[[ 0.5 ],
          [ 0.5 ],
          [-0.45],
          [-0.45],
          [ 0.  ],
          [ 0.  ]],
  <BLANKLINE>
         [[ 2.1 ],
          [ 2.1 ],
          [-2.  ],
          [-2.  ],
          [ 0.  ],
          [ 0.  ]]])
  
  References
  ----------
  .. [1] E. Keogh & M. Pazzani. Scaling up dynamic time warping for
     datamining applications. SIGKDD 2000, pp. 285--289.
class_docstr_tok: ["Piecewise","Aggregate","Approximation","(","PAA",")","transformation",".","PAA","was","originally","presented","in","[","1","]","_.","Parameters","--","--","--","--","--","n_segments",":","int","(","default",":","1",")","Number","of","PAA","segments","to","compute","Notes","--","--","-","This","method","requires","a","dataset","of","equal-sized","time","series",".","Examples","--","--","--","--",">",">",">","paa","=","PiecewiseAggregateApproximation","(","n_segments=3",")",">",">",">","data","=","[","[","-1.",",","2.",",","0.1",",","-1.",",","1.",",","-1",".","]",",","[","1.",",","3.2",",","-1.",",","-3.",",","1.",",","-1",".","]","]",">",">",">","paa_data","=","paa.fit_transform","(","data",")",">",">",">","paa_data.shape","(","2",",","3",",","1",")",">",">",">","paa_data","array","(","[","[","[","0.5","]",",","[","-0.45","]",",","[","0",".","]","]",",","<","BLANKLINE",">","[","[","2.1","]",",","[","-2",".","]",",","[","0",".","]","]","]",")",">",">",">","paa.distance_paa","(","paa_data","[","0","]",",","paa_data","[","1","]",")","#","doctest",":","+ELLIPSIS","3.15039","...",">",">",">","paa.distance","(","data","[","0","]",",","data","[","1","]",")","#","doctest",":","+ELLIPSIS","3.15039","...",">",">",">","paa.inverse_transform","(","paa_data",")","array","(","[","[","[","0.5","]",",","[","0.5","]",",","[","-0.45","]",",","[","-0.45","]",",","[","0",".","]",",","[","0",".","]","]",",","<","BLANKLINE",">","[","[","2.1","]",",","[","2.1","]",",","[","-2",".","]",",","[","-2",".","]",",","[","0",".","]",",","[","0",".","]","]","]",")","References","--","--","--","--","--","..","[","1","]","E.","Keogh","&","M.","Pazzani",".","Scaling","up","dynamic","time","warping","for","datamining","applications",".","SIGKDD","2000",",","pp",".","285","--","289","."]
code: def _transform(self, X, y=None):
      n_ts, sz, d = X.shape
      X_transformed = numpy.empty((n_ts, self.n_segments, d))
      for i_ts in range(n_ts):
          sz_segment = ts_size(X[i_ts]) // self.n_segments
          for i_seg in range(self.n_segments):
              start = i_seg * sz_segment
              end = start + sz_segment
              segment = X[i_ts, start:end, :]
              X_transformed[i_ts, i_seg, :] = segment.mean(axis=0)
      return X_transformed
  
imports: import numpy
  from scipy.stats import norm
  from sklearn.base import TransformerMixin
  from sklearn.utils.validation import check_is_fitted, check_array
  from tslearn.bases import BaseModelPackage, TimeSeriesBaseEstimator
  from tslearn.metrics.cysax import cydist_sax, cyslopes, cydist_1d_sax, inv_transform_1d_sax, inv_transform_sax, inv_transform_paa
  from tslearn.utils import ts_size, check_dims
label_desc: Use image node_id 5 for calling the PiecewiseAggregateApproximation obj's underlying member method code with example usage: obj._transform(X, y) and returns: X_transformed