chemometrics.plot_svd

chemometrics.plot_svd(D, n_comp=5, n_eigenvalues=20)

Plot SVD-matrices in three subplots.

Perform a Singular Value Decomposition (SVD) and plot the three matrices in three subplots. The number of singular vectors shown is n_comp. The left subplot contains the left singular vectors, the middle subplot the singular values, the right subplot the right singular vectors. The function is a useful tool to get first insights into a data set. It helps to evaluate which components contain information and which mainly noise. Compared to Principal Component Analysis (PCA), the singular vectors are normalized and scaling results from the eigenvalues.

Parameters
  • D ((n, m) ndarray) – Matrix containing data to plot and analyze. The function expects. n samples with m signals (e.g. wavelengths, measurements).

  • n_comp (int) – Number of singular vectors to plot.

  • n_eigenvalues (int) –

Returns

fig – A list of line objects generated by plotting the spectra.

Return type

figure

References

Plot style adapted from personal communication with Matthias Sawall as in Figure 5 1.

1

M. Sawall, A. Börner, C. Kubis, D. Selent, R. Ludwig, and K. Neymeyr. Model-free multivariate curve resolution combined with model-based kinetics: Algorithm and applications. J. Chemom., 26:538–548, 2012.