'Transform the data X according to the fitted NMF model
Parameters
X : {array-like, sparse matrix}, shape (n_samples, n_features)
Data matrix to be transformed by the model
Returns
W : array, shape (n_samples, n_components)
Transformed data'

def transform(self, X):

    check_is_fitted(self, 'n_components_')
    (W, _, n_iter_) = non_negative_factorization(X=X, W=None, H=self.components_, n_components=self.n_components_, init=self.init, update_H=False, solver=self.solver, beta_loss=self.beta_loss, tol=self.tol, max_iter=self.max_iter, alpha=self.alpha, l1_ratio=self.l1_ratio, regularization='both', random_state=self.random_state, verbose=self.verbose, shuffle=self.shuffle)
    return W
