Nice properties that matrices in SVD decomposition have?
They are orthonormal. This means columns are orthogonal to each other.
Linear Algebra Review
- Matrix-vector multiplication
- Matrix-matrix multiplication
Step-by-step in creating matrices in SVD & NMF
- Create Term-Document Matrix (TFIDF)
- You can use TfidfVectorizer()
- For non-negative matrix factorisation (NMF)
- Decompose it into N components using decomposition.NMF from sklearn
- For singular value decomposition (SVD)
- Decompose into multiple matrices (U, s, V) using decomposition.randomized_svd
SVD applied to a big matrix is slow and so randomised SVD provides a solution to this as it can heavily speed things up as shown below: