'Center kernel matrix.
Parameters
K : numpy array of shape [n_samples1, n_samples2]
Kernel matrix.
y : (ignored)
.. deprecated:: 0.19
This parameter will be removed in 0.21.
copy : boolean, optional, default True
Set to False to perform inplace computation.
Returns
K_new : numpy array of shape [n_samples1, n_samples2]'

def transform(self, K, y='deprecated', copy=True):

    if ((not isinstance(y, string_types)) or (y != 'deprecated')):
        warnings.warn('The    parameter    y    on    transform()    is    deprecated    since    0.19    and    will    be    removed    in    0.21', DeprecationWarning)
    check_is_fitted(self, 'K_fit_all_')
    K = check_array(K, copy=copy, dtype=FLOAT_DTYPES)
    K_pred_cols = (np.sum(K, axis=1) / self.K_fit_rows_.shape[0])[:, np.newaxis]
    K -= self.K_fit_rows_
    K -= K_pred_cols
    K += self.K_fit_all_
    return K
