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

    https://github.com/apache/spark/pull/1778#discussion_r17818718
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/mllib/stat/MultivariateStatisticalSummary.scala
 ---
    @@ -53,4 +53,14 @@ trait MultivariateStatisticalSummary {
        * Minimum value of each column.
        */
       def min: Vector
    +
    +  /**
    +   * Euclidean magnitude of each column
    +   */
    +  def normL2: Vector
    +
    +  /**
    +   * L1 norm of each column
    +   */
    +  def normL1: Vector
    --- End diff --
    
    For general vectors and matrices, L1 and L2 norms are widely accepted as 
summaries of a vector and are standard linear algebra: 
http://en.wikipedia.org/wiki/Norm_(mathematics)#p-norm
    
    `RowMatrix` is a general matrix, not necessarily holding random variable 
samples in its columns.
    By using the names `normL1` and `normL2` it is clear what we're talking 
about - there is no mistaking what L1 means. Whereas if I were to name them 
`norm1` and use some averaging, I think the name is ambiguous and requires the 
user to know we're assuming the matrix holds random variable samples in its 
columns. No need to confuse the user to make an assumption we don't need.


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