'Return the data transformed by a callable kernel'

def _compute_kernel(self, X):

    if callable(self.kernel):
        kernel = self.kernel(X, self.__Xfit)
        if sp.issparse(kernel):
            kernel = kernel.toarray()
        X = np.asarray(kernel, dtype=np.float64, order='C')
    return X
