# mahout-dev mailing list archives

##### Site index · List index
Message view
Top
From "Grant Ingersoll (JIRA)" <j...@apache.org>
Subject [jira] Issue Comment Edited: (MAHOUT-130) Vector should allow for other normalize powers than the L-2 norm
Date Tue, 09 Jun 2009 00:56:07 GMT
```
[ https://issues.apache.org/jira/browse/MAHOUT-130?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12717502#action_12717502
]

Grant Ingersoll edited comment on MAHOUT-130 at 6/8/09 5:54 PM:
----------------------------------------------------------------

{quote} val = 0;
for (int i = 0; i< cardinality(); i++){ val += Math.pow(getQuick(i), power); }
val = vec.zSum();
{quote}

I assume this last val assignment is a typo.  I've changed it and added an exception if power
<= 0.

Also, how much rounding error would you expect?  I notice a small difference (thousandths
place) when Implementing w/o the vector approach:
norm: [s3, 0:0.30010006671856176, 1:0.6002001334371235, 2:0.9003002001556853, ]  is not equal
to expected: [s3, 0:0.3028534321386899, 1:0.6057068642773799, 2:0.9085602964160698, ]

was (Author: gsingers):
{quote} val = 0;
for (int i = 0; i< cardinality(); i++){ val += Math.pow(getQuick(i), power); }
val = vec.zSum();
{quote}

Shall I assume this last val assignment is a typo?

Also, how much rounding error would you expect?  I notice a small difference (thousandths
place) when Implementing w/o the vector approach:
norm: [s3, 0:0.30010006671856176, 1:0.6002001334371235, 2:0.9003002001556853, ]  is not equal
to expected: [s3, 0:0.3028534321386899, 1:0.6057068642773799, 2:0.9085602964160698, ]

> Vector should allow for other normalize powers than the L-2 norm
> ----------------------------------------------------------------
>
>                 Key: MAHOUT-130
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-130
>             Project: Mahout
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Assignee: Grant Ingersoll
>            Priority: Minor
>         Attachments: MAHOUT-130.patch
>
>
> Modify Vector to allow other normalize functions for the Vector
> See http://www.lucidimagination.com/search/document/bf3a7a7a004d4191/norm_calculations

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

```
Mime
View raw message