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, numCols, values)[source]

Create a DenseMatrix

static fromML(mat)[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, numCols, colPtrs, rowIndices, values)[source]

Create a SparseMatrix