NMF and ICA assumptions
Quick answer
NMF approximates nonnegative data using nonnegative factors, while ICA attempts to recover statistically independent latent sources from mixtures. They encode different assumptions and answer different questions. Static examples tested locally with Python 3.13.5, scikit-learn 1.8.0 SciPy 1.17.0 and NumPy 2.3.5 where imported. ByteMind package execution is unverified.
Recover a nonnegative matrix
import numpy as npfrom sklearn.decomposition import NMFX=np.array([[2.,0],[0,3],[2,3]])m=NMF(n_components=2,init="nndsvda",random_state=7,max_iter=1000,tol=1e-8)W=m.fit_transform(X)print(bool((W>=0).all() and (m.components_>=0).all()))print(bool(np.linalg.norm(X-W@m.components_)<1e-5))Observed local output:
TrueTrueA rank-two nonnegative fixture can be reconstructed closely; convergence is not universal.
How it works
For nonnegative X (n by d), nonnegative matrix factorization seeks W (n by k) and H (k by d), both nonnegative, with X ≈ WH. The default Frobenius objective is nonconvex jointly in W and H, so initialization and iteration limits matter. Additive parts can be interpretable, but factors are not unique: scaling a column of W and inversely scaling the corresponding row of H preserves the product. For example, [2,3] times [[1,0],[0,2]] gives [2,6]. Negative values are outside standard NMF's input contract; do not blindly shift centered measurements merely to satisfy it. ICA models observations as linear mixtures of statistically independent sources; in the ideal identifiable model at most one source is Gaussian, the mixing has full column rank, and source order, sign and scale cannot be recovered uniquely. FastICA typically centers/whitens, then optimizes a non-Gaussianity contrast. Uncorrelated is weaker than independent: if a symmetric variable U has zero mean, U and U² can be uncorrelated but dependent. In scikit-learn FastICA, unit-variance whitening fixes a scale convention but not sign or permutation. Use convergence diagnostics, reconstruction and matching up to sign/permutation on synthetic mixtures; real source identities require external evidence.
Separate synthetic independent sources
import numpy as npfrom sklearn.decomposition import FastICAr=np.random.default_rng(7)S=np.column_stack([r.laplace(size=1000),r.uniform(-1,1,1000)])X=S@np.array([[1.,2.],[3.,1.]])m=FastICA(n_components=2,whiten="unit-variance",random_state=7,max_iter=1000)Z=m.fit_transform(X)c=np.abs(np.corrcoef(S.T,Z.T)[:2,2:])print(bool((c.max(axis=1)>.98).all() and len(set(c.argmax(axis=1)))==2))print(bool(np.allclose(m.inverse_transform(Z),X)))Observed local output:
TrueTrueAbsolute correlations and distinct matches account for sign and ordering ambiguity.
Common mistakes
Do not feed standardized negative values to ordinary NMF, equate ICA with PCA, or assign a semantic meaning to an ICA component from its sign or order. Low reconstruction error alone does not establish true sources.
Practice and next steps
Multiply W=[[1,2]] by H=[[3,1],[0,2]]. Scale W’s first column by two and halve H’s first row; verify reconstruction is unchanged. Explain why this makes factors nonunique. Complete the knowledge check and staged exercise. Next: t-SNE and UMAP caveats.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
NMF and ICA assumptions — knowledge check
Apply nmf and ica assumptions to new scenarios.
Which input violates ordinary NMF assumptions?
What happens if W column doubles and H row halves?
What does ICA seek beyond decorrelation?
How should recovered sources be matched in a synthetic ICA test?
Does accurate reconstruction prove semantic source identity?