Sparsity is the proportion of zero or empty entries in a vector, matrix, feature representation, or model parameter set. High sparsity can reduce storage and computation but may require specialized representations or algorithms.
The number of elements set to zero (or null) in a vector or matrix divided by the total number of entries in that vector or matrix. For example, consider a 100-element matrix in which 98 cells contain zero. The calculation of sparsity is as follows: Feature sparsity refers to the sparsity of a feature vector; model sparsity refers to the sparsity of the model weights.