September 2019
Intermediate to advanced
420 pages
10h 29m
English
Another useful dimensionality reduction technique is called 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 [13]: nmf = decomposition.NMF()In [14]: X2 = nmf.fit_transform(X)In [15]: plt.plot(X2[:, 0], X2[:, 1], 'o')... plt.xlabel('first non-negative component')... plt.ylabel('second non-negative component')... plt.axis([-5, 20, -5, 10])Out[15]: [-5, 20, ...Read now
Unlock full access