parameters: (self, X, y=None)
return_statement: return code
docstring: Encode the data as a sparse combination of the dictionary atoms.
  
          Coding method is determined by the object parameter
          `transform_algorithm`.
  
          Parameters
          ----------
          X : array of shape (n_samples, n_features)
              Test data to be transformed, must have the same number of
              features as the data used to train the model.
  
          Returns
          -------
          X_new : array, shape (n_samples, n_components)
              Transformed data
docstring_summary: Encode the data as a sparse combination of the dictionary atoms.
docstring_tokens: Encode the data as a sparse combination of the dictionary atoms .
function: def transform(self, X, y=None):
          """Encode the data as a sparse combination of the dictionary atoms.
  
          Coding method is determined by the object parameter
          `transform_algorithm`.
  
          Parameters
          ----------
          X : array of shape (n_samples, n_features)
              Test data to be transformed, must have the same number of
              features as the data used to train the model.
  
          Returns
          -------
          X_new : array, shape (n_samples, n_components)
              Transformed data
  
          """
          check_is_fitted(self, 'components_')
  
          # XXX : kwargs is not documented
          X = check_array(X)
          n_samples, n_features = X.shape
  
          code = sparse_encode(
              X, self.components_, algorithm=self.transform_algorithm,
              n_nonzero_coefs=self.transform_n_nonzero_coefs,
              alpha=self.transform_alpha, n_jobs=self.n_jobs)
  
          if self.split_sign:
              # feature vector is split into a positive and negative side
              n_samples, n_features = code.shape
              split_code = np.empty((n_samples, 2 * n_features))
              split_code[:, :n_features] = np.maximum(code, 0)
              split_code[:, n_features:] = -np.minimum(code, 0)
              code = split_code
  
          return code
function_tokens: def transform ( self , X , y = None ) : check_is_fitted ( self , 'components_' ) # XXX : kwargs is not documented X = check_array ( X ) n_samples , n_features = X . shape code = sparse_encode ( X , self . components_ , algorithm = self . transform_algorithm , n_nonzero_coefs = self . transform_n_nonzero_coefs , alpha = self . transform_alpha , n_jobs = self . n_jobs ) if self . split_sign : # feature vector is split into a positive and negative side n_samples , n_features = code . shape split_code = np . empty ( ( n_samples , 2 * n_features ) ) split_code [ : , : n_features ] = np . maximum ( code , 0 ) split_code [ : , n_features : ] = - np . minimum ( code , 0 ) code = split_code return code