non-negative matrix factorization is another unsupervised learning algorithm that aims to extract useful features it works similarly to pca and can also be used for dimensionality reduction as in pcawe are trying to write each data point as weighted sum of some componentsas illustrated in figure - but whereas in pca we wanted components that were orthogonal and that explained as much variance of the data as possiblein nmfwe want the components and the coefficients to be nonnegativethat iswe want both the components and the coefficients to be greater than or equal to zero consequentlythis method can only be applied to data where each feature is non-negativeas non-negative sum of non-negative components cannot become negative the process of decomposing data into non-negative weighted sum is particularly helpful for data that is created as the addition (or overlayof several independent sourcessuch as an audio track of multiple people speakingor music with many instruments in these situationsnmf can identify the original components that make up the combined data overallnmf leads to more interpretable components than pcaas negative components and coefficients can lead to hard-to-interpret cancellation effects the eigenfaces in figure - for examplecontain both positive and negative partsand as we mentioned in the description of pcathe sign is actually arbitrary before we apply nmf to the face datasetlet' briefly revisit the synthetic data applying nmf to synthetic data in contrast to when using pcawe need to ensure that our data is positive for nmf to be able to operate on the data this means where the data lies relative to the origin ( actually matters for nmf thereforeyou can think of the non-negative components that are extracted as directions from ( toward the data the following example (figure - shows the results of nmf on the twodimensional toy datain[ ]mglearn plots plot_nmf_illustration( unsupervised learning and preprocessing