Handling Sparse matrix — Concept behind Compressed Sparse Row (CSR) matrix | by Saishruthi Swaminathan | Towards Data Science

Submitted by michael on Mon, 07/05/2021 - 09:32

Scipy offers variety of sparse matrices functions that store only non-zero elements. By doing so, memory required for data storage can be minimized. Machine learning process often requires data frame to be in memory. It breaks down the data frame for fitting into RAM. By compressing, data can easily fit in RAM. Performing operations using only non-zero values of the sparse matrix can greatly increase execution speed of the algorithm.