Sparse matrix
稀疏矩阵指的是矩阵里面的元素大多都是0值。
与 sparse 相对的,就是 dense, which most elements of the matrix are nonzero
矩阵的稀疏性 = zero-valued elements / total number of elements
Sparse Representation
Q:稀疏表达有什么好处?
稀疏表达的意义在于降维,但是我还是不知道这个怎么搞得
Q:稀疏表达 sparse representation 与 降维 dimensionality reduction 本质区别在哪?
降维是将原 space 里的数据在某一个 subspace 里面表达,而稀疏表达是在 a union subspace 里面表达。
举个例子
(x, y, z)的空间中,(x, y)就是其中一个 subspace 。而 a union subspace 就包含了多个 subspace ,比如[(x, y), (y, z), (z, x)]就是 a union subspace。
Q:如何求得数据的稀疏矩阵?
to be continue
Storing a sparse matrix
Compressed sparse row(CSR, CRS pr Yale format)
1 | # data |
1 | A = data = (10, 20, 30, 40, 50, 60, 70, 80) |
List of list(LIL)
LIL stores one list per row, with each entry containing the column index and the value. Typically, these entries are kept sorted by column index for faster lookup. This is another format good for incremental matrix construction.
1 | MatrixA: |
例子:这里
参考:
https://www.zhihu.com/question/26602796/answer/33431062
https://www.zhihu.com/question/24124122/answer/50403932
https://en.wikipedia.org/wiki/Sparse_matrix