Matrices

class pyspark.mllib.linalg.Matrices[source]

Methods

dense(numRows, numCols, values)

Create a DenseMatrix

fromML(mat)

Convert a matrix from the new mllib-local representation.

sparse(numRows, numCols, colPtrs, …)

Create a SparseMatrix

Methods Documentation

static dense(numRows: int, numCols: int, values: Union[bytes, Iterable[float]])pyspark.mllib.linalg.DenseMatrix[source]

Create a DenseMatrix

static fromML(mat: pyspark.ml.linalg.Matrix)pyspark.mllib.linalg.Matrix[source]

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

New in version 2.0.0.

Parameters
matpyspark.ml.linalg.Matrix
Returns
pyspark.mllib.linalg.Matrix
static sparse(numRows: int, numCols: int, colPtrs: Union[bytes, Iterable[int]], rowIndices: Union[bytes, Iterable[int]], values: Union[bytes, Iterable[float]])pyspark.mllib.linalg.SparseMatrix[source]

Create a SparseMatrix