class_docstr: Transform features using quantiles information.
  
  Stripped down version of sklearn.preprocessing.QuantileTransformer.
  https://github.com/scikit-learn/scikit-learn/blob/
  863e58fcd5ce960b4af60362b44d4f33f08c0f97/sklearn/preprocessing/_data.py
  
  Putting directly in ddsp library to avoid dependency on sklearn that breaks
  when pickling and unpickling from different versions of sklearn.
class_docstr_tok: ["Transform","features","using","quantiles","information",".","Stripped","down","version","of","sklearn.preprocessing.QuantileTransformer",".","https",":","\/\/github.com\/scikit-learn\/scikit-learn\/blob\/","863e58fcd5ce960b4af60362b44d4f33f08c0f97\/sklearn\/preprocessing\/_data.py","Putting","directly","in","ddsp","library","to","avoid","dependency","on","sklearn","that","breaks","when","pickling","and","unpickling","from","different","versions","of","sklearn","."]
docstr: Compute the quantiles used for transforming.
  
  Parameters
  ----------
  Args:
    x: {array-like, sparse matrix} of shape (n_samples, n_features)
      The data used to scale along the features axis. If a sparse
      matrix is provided, it will be converted into a sparse
      ``csc_matrix``. Additionally, the sparse matrix needs to be
      nonnegative if `ignore_implicit_zeros` is False.
  
  Returns:
    self: object
       Fitted transformer.
docstr_tok: ["Compute","the","quantiles","used","for","transforming",".","Parameters","--","--","--","--","--","Args",":","x",":","{","array-like",",","sparse","matrix","}","of","shape","(","n_samples",",","n_features",")","The","data","used","to","scale","along","the","features","axis",".","If","a","sparse","matrix","is","provided",",","it","will","be","converted","into","a","sparse","``","csc_matrix","``",".","Additionally",",","the","sparse","matrix","needs","to","be","nonnegative","if","`","ignore_implicit_zeros","`","is","False",".","Returns",":","self",":","object","Fitted","transformer","."]
code: def fit(self, x):
      """Compute the quantiles used for transforming.
  
      Parameters
      ----------
      Args:
        x: {array-like, sparse matrix} of shape (n_samples, n_features)
          The data used to scale along the features axis. If a sparse
          matrix is provided, it will be converted into a sparse
          ``csc_matrix``. Additionally, the sparse matrix needs to be
          nonnegative if `ignore_implicit_zeros` is False.
  
      Returns:
        self: object
           Fitted transformer.
      """
      if self.n_quantiles <= 0:
          raise ValueError(
              "Invalid value for 'n_quantiles': %d. "
              "The number of quantiles must be at least one."
              % self.n_quantiles
          )
      n_samples = x.shape[0]
      self.n_quantiles_ = max(1, min(self.n_quantiles, n_samples))
  
      # Create the quantiles of reference
      self.references_ = np.linspace(
          0, 1, self.n_quantiles_, endpoint=True
      )
      self._dense_fit(x, self.random_state)
      return self
  
file_path: ddsp/ddsp/training/postprocessing.py
imports: from ddsp import spectral_ops
  from ddsp.core import hz_to_midi
  import numpy
  from scipy import stats
  import tensorflow.compat.v2
label_desc: Use image node_id 3 for calling the QuantileTransformer obj's underlying member method code with example usage: obj.fit(x) and returns: self