SparseMatrix

class pyspark.mllib.linalg.SparseMatrix(numRows: int, numCols: int, colPtrs: Union[bytes, Iterable[int]], rowIndices: Union[bytes, Iterable[int]], values: Union[bytes, Iterable[float]], isTransposed: bool = False)[source]

Sparse Matrix stored in CSC format.

Methods

asML()

Convert this matrix to the new mllib-local representation.

toArray()

Return an numpy.ndarray

toDense()

Methods Documentation

asML()pyspark.ml.linalg.SparseMatrix[source]

Convert this matrix to the new mllib-local representation. This does NOT copy the data; it copies references.

New in version 2.0.0.

Returns
pyspark.ml.linalg.SparseMatrix
toArray() → numpy.ndarray[source]

Return an numpy.ndarray

toDense()pyspark.mllib.linalg.DenseMatrix[source]