July 2017
Intermediate to advanced
382 pages
9h 13m
English
Another useful dimensionality reduction technique is called Non-negative Matrix Factorization (NMF). It again implements the same basic mathematical operations as PCA and ICA, but it has the additional constraint that it only operates on non-negative data. In other words, we cannot have negative values in our feature matrix if we want to use NMF; the resulting components of the decomposition will all have non-negative values as well.
In scikit-learn, NMF works exactly like ICA:
In [12]: nmf = decomposition.NMF()In [13]: X2 = nmf.fit_transform(X)In [14]: plt.plot(X2[:, 0], X2[:, 1], 'o')... plt.xlabel('first non-negative component')... plt.ylabel('second non-negative component')... plt.axis([-5, ...Read now
Unlock full access