'Apply feature map to X.
Computes an approximate feature map using the kernel
between some training points and X.
Parameters
X : array-like, shape=(n_samples, n_features)
Data to transform.
Returns
X_transformed : array, shape=(n_samples, n_components)
Transformed data.'

def transform(self, X):

    check_is_fitted(self, 'components_')
    X = check_array(X, accept_sparse='csr')
    kernel_params = self._get_kernel_params()
    embedded = pairwise_kernels(X, self.components_, metric=self.kernel, filter_params=True, **kernel_params)
    return np.dot(embedded, self.normalization_.T)
