spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mateiz <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-1212] Adding sparse data support and up...
Date Mon, 24 Mar 2014 00:35:19 GMT
Github user mateiz commented on a diff in the pull request:

    https://github.com/apache/spark/pull/117#discussion_r10870394
  
    --- 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 --
    
    I.e. the `val precisionBound1 = 2.0 * EPSILON * sumSquaredNorm / (normDiff * normDiff
+ EPSILON)`


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

Mime
View raw message