all three of them we want to recover the decomposition of the mixed signal into the original components we assume that we have many different ways to observe the mixture (say measurement devices)each of which provides us with series of measurementsin[ ]mix data into -dimensional state np random randomstate( uniform(size=( ) np dot(sa tprint("shape of measurements{}format( shape)out[ ]shape of measurements( we can use nmf to recover the three signalsin[ ]nmf nmf(n_components= random_state= s_ nmf fit_transform(xprint("recovered signal shape{}format(s_ shape)out[ ]recovered signal shape( for comparisonwe also apply pcain[ ]pca pca(n_components= pca fit_transform(xfigure - shows the signal activity that was discovered by nmf and pcain[ ]models [xss_hnames ['observations (first three measurements)''true sources''nmf recovered signals''pca recovered signals'figaxes plt subplots( figsize=( )gridspec_kw={'hspace' }subplot_kw={'xticks'()'yticks'()}for modelnameax in zip(modelsnamesaxes)ax set_title(nameax plot(model[:: ]'-' unsupervised learning and preprocessing