'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'

def transform(self, X):

    check_is_fitted(self, 'components_')
    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:
        (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
