Skip to content

Commit 07808fc

Browse files
author
Nick Pentreath
committed
Add since tag and update doc string for multiply methods
1 parent 56205d2 commit 07808fc

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

python/pyspark/mllib/linalg/distributed.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -369,12 +369,14 @@ def computePrincipalComponents(self, k):
369369
"""
370370
return self._java_matrix_wrapper.call("computePrincipalComponents", k)
371371

372+
@since('2.2.0')
372373
def multiply(self, matrix):
373374
"""
374-
Multiplies the given RowMatrix with another matrix.
375+
Multiply this matrix by a local dense matrix on the right.
375376
376-
:param matrix: Matrix to multiply with.
377-
:returns: RowMatrix
377+
:param matrix: a local dense matrix whose number of rows must match the number of columns
378+
of this matrix
379+
:returns: :py:class:`RowMatrix`
378380
379381
>>> rm = RowMatrix(sc.parallelize([[0, 1], [2, 3]]))
380382
>>> rm.multiply(DenseMatrix(2, 2, [0, 2, 1, 3])).rows.collect()
@@ -699,12 +701,14 @@ def computeSVD(self, k, computeU=False, rCond=1e-9):
699701
"computeSVD", int(k), bool(computeU), float(rCond))
700702
return SingularValueDecomposition(j_model)
701703

704+
@since('2.2.0')
702705
def multiply(self, matrix):
703706
"""
704-
Multiplies the given IndexedRowMatrix with another matrix.
707+
Multiply this matrix by a local dense matrix on the right.
705708
706-
:param matrix: Matrix to multiply with.
707-
:returns: IndexedRowMatrix
709+
:param matrix: a local dense matrix whose number of rows must match the number of columns
710+
of this matrix
711+
:returns: :py:class:`IndexedRowMatrix`
708712
709713
>>> mat = IndexedRowMatrix(sc.parallelize([(0, (0, 1)), (1, (2, 3))]))
710714
>>> mat.multiply(DenseMatrix(2, 2, [0, 2, 1, 3])).rows.collect()

0 commit comments

Comments
 (0)