> For the complete documentation index, see [llms.txt](https://nag-9-s.gitbook.io/machine-learning/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nag-9-s.gitbook.io/machine-learning/mlib/data-types/matrices/distributed-matrix/coordinatematrix.md).

# CoordinateMatrix

A `CoordinatedMatrix` stores data as tuples of row, column indexes, and element value.

elements values are explicit defined by using IndexedRow(row\_index, col\_index, value).

CoordinateMatrix stores its values as an RDD of MatrixEntry objects, which contain individual entries and their (i,j) positions in the matrix. This isn’t an efficient way of storing data, so you should use CoordinateMatrix only for storing sparse matrices. Otherwise, it could consume too much memory.

![](https://422781072-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LsbZSeL57mlsVm1bwrG%2F-LsbZa1KWgHxmC9yq5FP%2F-LsbZegBLrYoknHlIrxp%2FCoOrdM.png?generation=1572621954580280\&alt=media)
