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 percentiles for dense matrices.
  
  Args:
    x: ndarray of shape (n_samples, n_features)
      The data used to scale along the features axis.
    random_state: Numpy random number generator.
docstr_tok: ["Compute","percentiles","for","dense","matrices",".","Args",":","x",":","ndarray","of","shape","(","n_samples",",","n_features",")","The","data","used","to","scale","along","the","features","axis",".","random_state",":","Numpy","random","number","generator","."]
code: def _dense_fit(self, x, random_state):
      """Compute percentiles for dense matrices.
  
      Args:
        x: ndarray of shape (n_samples, n_features)
          The data used to scale along the features axis.
        random_state: Numpy random number generator.
      """
      n_samples, _ = x.shape
      references = self.references_ * 100
  
      self.quantiles_ = []
      for col in x.T:
          if self.subsample < n_samples:
              subsample_idx = random_state.choice(
                  n_samples, size=self.subsample, replace=False
              )
              col = col.take(subsample_idx, mode="clip")
          self.quantiles_.append(np.nanpercentile(col, references))
      self.quantiles_ = np.transpose(self.quantiles_)
      # Due to floating-point precision error in `np.nanpercentile`,
      # make sure that quantiles are monotonically increasing.
      # Upstream issue in numpy:
      # https://github.com/numpy/numpy/issues/14685
      self.quantiles_ = np.maximum.accumulate(self.quantiles_)
  
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 2 for calling the QuantileTransformer obj's underlying member method code with example usage: obj._dense_fit(x, random_state) without return types