'Compute the quantiles used for transforming.
Parameters
X : ndarray or sparse matrix, 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
Returns self'

def fit(self, X, y=None):

    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))
    if (self.subsample <= 0):
        raise ValueError(("Invalid    value    for    'subsample':    %d.    The    number    of    subsamples    must    be    at    least    one." % self.subsample))
    if (self.n_quantiles > self.subsample):
        raise ValueError('The    number    of    quantiles    cannot    be    greater    than    the    number    of    samples    used.    Got    {}    quantiles    and    {}    samples.'.format(self.n_quantiles, self.subsample))
    X = self._check_inputs(X)
    rng = check_random_state(self.random_state)
    self.references_ = np.linspace(0, 1, self.n_quantiles, endpoint=True)
    if sparse.issparse(X):
        self._sparse_fit(X, rng)
    else:
        self._dense_fit(X, rng)
    return self
