'Fit KernelCenterer
Parameters
K : numpy array of shape [n_samples, n_samples]
Kernel matrix.
Returns
self : returns an instance of self.'

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

    K = check_array(K, dtype=FLOAT_DTYPES)
    n_samples = K.shape[0]
    self.K_fit_rows_ = (np.sum(K, axis=0) / n_samples)
    self.K_fit_all_ = (self.K_fit_rows_.sum() / n_samples)
    return self
