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

    https://github.com/apache/spark/pull/117#discussion_r10870354
  
    --- Diff: mllib/src/main/scala/org/apache/spark/mllib/util/MLUtils.scala ---
    @@ -106,18 +111,46 @@ object MLUtils {
       }
     
       /**
    -   * Return the squared Euclidean distance between two vectors.
    +   * Returns the squared Euclidean distance between two vectors. The 
following formula will be used
    +   * if it does not introduce too much numerical error:
    +   * <pre>
    +   *   \|a - b\|_2^2 = \|a\|_2^2 + \|b\|_2^2 - 2 a^T b.
    +   * </pre>
    +   * When both vector norms are given, this is faster than computing the 
squared distance directly,
    +   * especially when one of the vectors is a sparse vector.
    --- End diff --
    
    Sorry in particular I meant whether there's a reference for the "too much 
numerical error" condition. I know this formula doesn't need one.


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

Reply via email to