class_docstr: Marginal transformation that transforms the target via an empirical CDF to
  a standard gaussian as described here: https://arxiv.org/abs/1910.03002.
  
  To be used in conjunction with a multivariate gaussian to from a copula.
  Note that this transformation is currently intended for multivariate
  targets only.
class_docstr_tok: ["Marginal","transformation","that","transforms","the","target","via","an","empirical","CDF","to","a","standard","gaussian","as","described","here",":","https",":","\/\/arxiv.org\/abs\/1910.03002",".","To","be","used","in","conjunction","with","a","multivariate","gaussian","to","from","a","copula",".","Note","that","this","transformation","is","currently","intended","for","multivariate","targets","only","."]
docstr: Performs several preprocess operations for computing the empirical CDF.
  1) Reshaping the data. 2) Normalizing the target length. 3) Adding
  noise to avoid zero slopes (training only) 4) Sorting the target to
  compute the empirical CDF.
  
  Parameters
  ----------
  data
      DataEntry with input data.
  is_train
      if is_train is True, this function adds noise to the target to
      avoid zero slopes in the piece-wise linear function.
  Returns
  -------
docstr_tok: ["Performs","several","preprocess","operations","for","computing","the","empirical","CDF",".","1",")","Reshaping","the","data",".","2",")","Normalizing","the","target","length",".","3",")","Adding","noise","to","avoid","zero","slopes","(","training","only",")","4",")","Sorting","the","target","to","compute","the","empirical","CDF",".","Parameters","--","--","--","--","--","data","DataEntry","with","input","data",".","is_train","if","is_train","is","True",",","this","function","adds","noise","to","the","target","to","avoid","zero","slopes","in","the","piece-wise","linear","function",".","Returns","--","--","--","-"]
code: def _preprocess_data(self, data: DataEntry, is_train: bool):
      """
      Performs several preprocess operations for computing the empirical CDF.
      1) Reshaping the data. 2) Normalizing the target length. 3) Adding
      noise to avoid zero slopes (training only) 4) Sorting the target to
      compute the empirical CDF.
  
      Parameters
      ----------
      data
          DataEntry with input data.
      is_train
          if is_train is True, this function adds noise to the target to
          avoid zero slopes in the piece-wise linear function.
      Returns
      -------
      """
      # (target_length, target_dim)
      past_target_vec = data[self.past_target_field].copy()
  
      # pick only observed values
      target_length, target_dim = past_target_vec.shape
  
      # (target_length, target_dim)
      past_observed = (data[self.past_observed_field] > 0) * (
          data["past_is_pad"].reshape((-1, 1)) == 0
      )
      assert past_observed.ndim == 2
      assert target_dim == self.target_dim
  
      past_target_vec = past_target_vec[past_observed.min(axis=1)]
  
      assert past_target_vec.ndim == 2
      assert past_target_vec.shape[1] == self.target_dim
  
      expected_length = (
          target_length
          if self.max_context_length is None
          else self.max_context_length
      )
  
      if target_length != expected_length:
          # Fills values in the case where past_target_vec.shape[-1] <
          # target_length
          # as dataset.loader.BatchBuffer does not support varying shapes
          past_target_vec = CDFtoGaussianTransform._fill(
              past_target_vec, expected_length
          )
  
      # sorts along the time dimension to compute empirical CDF of each
      # dimension
      if is_train:
          past_target_vec = self._add_noise(past_target_vec).astype(
              self.dtype
          )
  
      past_target_vec.sort(axis=0)
  
      assert past_target_vec.shape == (expected_length, self.target_dim)
  
      data[self.sort_target_field] = past_target_vec
  
imports: from typing import Callable, Iterator, List, Optional, Tuple, Type
  import numpy
  from toolz import valmap
  from gluonts.core.component import validated, tensor_to_numpy
  from gluonts.dataset.common import DataEntry
  from gluonts.exceptions import assert_data_error
  from ._base import FlatMapTransformation, MapTransformation, SimpleTransformation
label_desc: Use image node_id 3 for calling the CDFtoGaussianTransform obj's underlying member method code with example usage: obj._preprocess_data(data, is_train) without return types