
Matrix Decomposition
by marimo team
An interactive exploration of matrix decomposition techniques.
About this notebook
This notebook shows three matrix decompositions of a matrix that you enter yourself. It has no external dataset. You set the numbers in an editable grid. The notebook then computes the SVD, the QR decomposition, and the LU decomposition. It uses numpy for the SVD (numpy.linalg.svd) and the QR (numpy.linalg.qr). It uses scipy for the LU decomposition (scipy.linalg.lu). Short notes describe what each decomposition reveals and where people use it.
Two sliders set the number of rows and the number of columns. Each slider runs from 1 to 10 and starts at 3. The sliders control the size of an editable matrix widget. Each cell of that widget accepts a value from -10 to 10. When you change a value, the notebook reads the matrix again and recomputes all three decompositions. Each result appears as a row of read- only matrices with equals signs and multiplication signs between the factors. So you see A next to its factors, such as U, Sigma, and V transpose for the SVD.











