parameters: (self, X)
return_statement: return X
docstring: Return the data transformed by a callable kernel
docstring_summary: Return the data transformed by a callable kernel
docstring_tokens: Return the data transformed by a callable kernel
function: def _compute_kernel(self, X):
          """Return the data transformed by a callable kernel"""
          if callable(self.kernel):
              # in the case of precomputed kernel given as a function, we
              # have to compute explicitly the kernel matrix
              kernel = self.kernel(X, self.__Xfit)
              if sp.issparse(kernel):
                  kernel = kernel.toarray()
              X = np.asarray(kernel, dtype=np.float64, order='C')
          return X
function_tokens: def _compute_kernel ( self , X ) : if callable ( self . kernel ) : # in the case of precomputed kernel given as a function, we # have to compute explicitly the kernel matrix kernel = self . kernel ( X , self . __Xfit ) if sp . issparse ( kernel ) : kernel = kernel . toarray ( ) X = np . asarray ( kernel , dtype = np . float64 , order = 'C' ) return X