'Learn a NMF model for the data X and returns the transformed data.
This is more efficient than calling fit followed by transform.
Parameters
X : {array-like, sparse matrix}, shape (n_samples, n_features)
Data matrix to be decomposed
W : array-like, shape (n_samples, n_components)
If init=\'custom\', it is used as initial guess for the solution.
H : array-like, shape (n_components, n_features)
If init=\'custom\', it is used as initial guess for the solution.
Returns
W : array, shape (n_samples, n_components)
Transformed data.'

def fit_transform(self, X, y=None, W=None, H=None):

    X = check_array(X, accept_sparse=('csr', 'csc'), dtype=float)
    (W, H, n_iter_) = non_negative_factorization(X=X, W=W, H=H, n_components=self.n_components, init=self.init, update_H=True, 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)
    self.reconstruction_err_ = _beta_divergence(X, W, H, self.beta_loss, square_root=True)
    self.n_components_ = H.shape[0]
    self.components_ = H
    self.n_iter_ = n_iter_
    return W
