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

    https://github.com/apache/spark/pull/5872#discussion_r29761983
  
    --- Diff: python/pyspark/mllib/linalg.py ---
    @@ -633,6 +743,57 @@ def stringify(vector):
             """
             return str(vector)
     
    +    @staticmethod
    +    def dot(a, b):
    +        """
    +        Dot product between two vectors.
    +        a and b can be of type, SparseVector, DenseVector, np.ndarray
    +        or array.array.
    +
    +        >>> a = Vectors.sparse(4, [(0, 1), (3, 4)])
    +        >>> b = Vectors.dense([23, 41, 9, 1])
    +        >>> Vectors.dot(a, b)
    +        27.0
    +        >>> Vectors.dot(a, a)
    +        17.0
    +        >>> Vectors.dot(a, np.array([0, 1, 2, 4]))
    +        16.0
    +        """
    +        a, b = _convert_to_vector(a), _convert_to_vector(b)
    +        return a.dot(b)
    +
    +    @staticmethod
    +    def squared_distance(a, b):
    --- End diff --
    
    I'm thinking we should keep both for a couple of versions, deprecate 
squared_distance and advice users to use sqdist. (At least that's how it works 
in sklearn.)


---
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