Extremely large reconstruction errors in NMF First time in this stack...
I am doing some audio analysis. I have a spectrogram ($N\approx 33000, M=1024$) and I need to run an NMF algorithm on it. I am using the Scikit learn implementation. And the code on Github.


Immediately, what strikes me strange, is if you look at the fit_transform functions, the returned signal representation is called W, which makes me believe that the dictionary learned is our H. Aren't the naming conventions for these two components the opposite?
Second, my reconstruction error is in the thousands. Any suggestions on what I may be doing wrong?


My spectrogram is non negative, as required.
When you decompose $X \approx WH$, the columns of $W$ form the dictionary and the columns of $H$ are the time varying weights. In your example, if you choose 150 components, then $W$ should be $33k \times 150$ and $H$ should be $150 \times 1024$.

The error "in thousands" could mean one of two things:


It's practically "zero" if you normalize it by the Frobenius norm of the spectrogram $X$, in which case all is well, or,
Perhaps your sound signal is too rich to be completely representable by 150 components and you should experiment by increasing that number.


It is also worth noting that squared error is often not a good measure for audio perception. Two signals with a large squared difference may sound almost the same.