.. _book_fig_chapter7_fig_svd_visual: Plot a visual representation of an SVD -------------------------------------- Figure 7.3 Singular value decomposition (SVD) can factorize an N x K matrix into :math:`U \Sigma V^T`. There are different conventions for computing the SVD in the literature, and this figure illustrates the convention used in this text. The matrix of singular values :math:`\Sigma` is always a square matrix of size [R x R] where R = min(N, K). The shape of the resulting U and V matrices depends on whether N or K is larger. The columns of the matrix U are called the left-singular vectors, and the columns of the matrix V are called the right-singular vectors. The columns are orthonormal bases, and satisfy :math:`U^T U = V^T V = I`. .. image:: ../images/chapter7/fig_svd_visual_1.png :scale: 100 :align: center .. raw:: html
**Code output:** .. raw:: html
.. literalinclude:: fig_svd_visual.txt .. raw:: html
**Python source code:** .. raw:: html
.. literalinclude:: fig_svd_visual.py :lines: 16- .. raw:: html
:download:`[download source: fig_svd_visual.py] ` .. raw:: html