'Makes sure centering is not enabled for sparse matrices.'

def _check_array(self, X, copy):

    X = check_array(X, accept_sparse=('csr', 'csc'), copy=self.copy, estimator=self, dtype=FLOAT_DTYPES)
    if sparse.issparse(X):
        if self.with_centering:
            raise ValueError('Cannot    center    sparse    matrices:    use    `with_centering=False`    instead.    See    docstring    for    motivation    and    alternatives.')
    return X
