what is sparse matrix

what is sparse matrix

1 year ago 91
Nature

A sparse matrix is a matrix in which most of the elements are zero. There is no strict definition regarding the proportion of zero-value elements for a matrix to qualify as sparse, but a common criterion is that the number of non-zero elements is roughly equal to the number of rows or columns. By contrast, if most of the elements are non-zero, the matrix is considered dense. Sparse data is by nature more easily compressed and thus requires significantly less storage. Some very large sparse matrices are infeasible to manipulate using standard dense-matrix algorithms. Storing a sparse matrix requires less memory if only the non-zero entries are stored. Depending on the number and distribution of the non-zero entries, different data structures can be used and yield huge savings in memory when compared to the basic approach. The trade-off is that accessing the individual elements becomes more complex, and additional structures are needed to be able to recover the original matrix unambiguously.

Sparse matrices are commonly used in applied machine learning, such as in data containing data-encodings that map categories to count, and even in whole subfields of machine learning such as natural language processing (NLP) . Python’s SciPy provides tools for creating sparse matrices using multiple data structures, as well as tools for converting a dense matrix to a sparse matrix. MATLAB also provides support for sparse matrices.

Read Entire Article