Re: [scikit-learn] How to get the factorization from NMF in scikit learn

2016-09-07 Thread Vlad Niculae
Hi Raphael, The other matrix in the factorization is the output of nmf.transform(A). In your example you forgot to fit the estimator; if you're just interested in the decomposition the recommended way is to get it in one line with W = nmf.fit_transform(A). While the mathematical description doesn

[scikit-learn] How to get the factorization from NMF in scikit learn

2016-09-07 Thread Raphael C
I am trying to use NMF from scikit learn. Given a matrix A this should give me a factorization into matrices W and H so that WH is approximately equal to A. As a sanity check I tried the following: from sklearn.decomposition import NMF import numpy as np A = np.array([[0,1,0],[1,0,1],[1,1,0]]) nmf