Github user dusenberrymw commented on a diff in the pull request:

    https://github.com/apache/spark/pull/7554#discussion_r35873295
  
    --- Diff: python/pyspark/mllib/linalg.py ---
    @@ -1152,9 +1156,416 @@ def sparse(numRows, numCols, colPtrs, rowIndices, 
values):
             return SparseMatrix(numRows, numCols, colPtrs, rowIndices, values)
     
     
    +class DistributedMatrix(object):
    +    """
    +    Represents a distributively stored matrix backed by one or
    +    more RDDs.
    +
    +    """
    +    def numRows(self):
    +        """Get or compute the number of rows."""
    +        raise NotImplementedError
    +
    +    def numCols(self):
    +        """Get or compute the number of cols."""
    +        raise NotImplementedError
    +
    +
    +class RowMatrix(DistributedMatrix):
    +    """
    +    .. note:: Experimental
    +
    +    Represents a row-oriented distributed Matrix with no meaningful
    +    row indices.
    +
    +    :param rows: An RDD of vectors.
    +    :param numRows: Number of rows in the matrix. A non-positive
    +                    value means unknown, at which point the number
    +                    of rows will be determined by the number of
    +                    records in the `rows` RDD.
    +    :param numCols: Number of columns in the matrix. A non-positive
    +                    value means unknown, at which point the number
    +                    of columns will be determined by the size of
    +                    the first row.
    +    """
    +    def __init__(self, rows, numRows=0, numCols=0):
    +        """Create a wrapper over a Java RowMatrix."""
    +        if not isinstance(rows, RDD):
    +            raise TypeError("rows should be an RDD of vectors, got %s" % 
type(rows))
    --- End diff --
    
    Yeah the argument doesn't have to be an RDD of actual `Vector` objects, but 
it should still be an RDD of _vectors_, which could be NumPy arrays, Python 
lists, `Vector`s, etc. for PySpark. The Spark MLlib Data Types guide makes this 
distinction for the end-user, so I think it is helpful to use it in the error 
message as well. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to