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

    https://github.com/apache/spark/pull/13997#discussion_r69176771
  
    --- Diff: python/pyspark/mllib/linalg/__init__.py ---
    @@ -1044,6 +1122,28 @@ def toSparse(self):
     
             return SparseMatrix(self.numRows, self.numCols, colPtrs, 
rowIndices, values)
     
    +    def asML(self):
    +        """
    +        Convert this matrix to the new mllib-local representation.
    +        This does NOT copy the data; it copies references.
    +
    +        >>> mllibDM = Matrices.dense(2, 2, [0, 1, 2, 3])
    +        >>> mlDM1 = newlinalg.Matrices.dense(2, 2, [0, 1, 2, 3])
    +        >>> mlDM2 = mllibDM.asML()
    +        >>> mlDM2 == mlDM1
    +        True
    +        >>> mllibDMt = DenseMatrix(2, 2, [0, 1, 2, 3], True)
    +        >>> mlDMt1 = newlinalg.DenseMatrix(2, 2, [0, 1, 2, 3], True)
    +        >>> mlDMt2 = mllibDMt.asML()
    +        >>> mlDMt2 == mlDMt1
    +        True
    +
    +        :return: :py:class:`pyspark.ml.linalg.DenseMatrix`
    +
    +        .. versionadded:: 2.0.0
    +        """
    +        return newlinalg.DenseMatrix(self.numRows, self.numCols, 
self.values, self.isTransposed)
    --- End diff --
    
    > 79 ;)


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to