![]() |
VOOZH | about |
In real world applications such as Natural Language Processing or image processing, data is often represented as large matrices that contain mostly zeros called as sparse matrices. Working with this high dimensional data can be computationally expensive and memory intensive. To handle this more efficiently, dimensionality reduction techniques is applied means shrinking the sparse matrix into a lower dimensional form while preserving most important features.
In Python, a common way to do this is:
Let's understand this with an Example.
This Example demonstrates dimensionality reduction of a sparse matrix using TruncatedSVD. It loads the digits dataset, standardizes it, converts it to a CSR sparse format and then reduces the number of features from 64 to 10 while preserving essential information.
Output
After applying TruncatedSVD, below code prints original number of features and the reduced number of features to confirm that dimensionality reduction has been successfully applied.
Output
It shows how TruncatedSVD effectively reduced the datasetβs features from 64 to 10.