What's wrong with EuclideanDistance -- looks straightforward to me. Is
it that you are looking to handle a sparse vector more efficiently?

FWIW I have a similar situation since my vectors are very sparse
(users don't express a preference for nearly all items). I just
stipulate that preference are handled in sorted order by item ID in
all cases. I just iterate through both vectors' actual entries at the
same time.

You can see the iteration in PearsonCorrelation, though that example
has a bunch of other junk in it that you wouldn't need.

On this note, might be good to think more about the implementation of
SparseVector. For example if it is desirable to iterate over entries
in order, a SortedMap like TreeMap would be better. actually right now
I am not sure how the values are coming back in any predictable
order...

On Sat, May 31, 2008 at 11:14 AM, Karl Wettin <[EMAIL PROTECTED]> wrote:
>
> 31 maj 2008 kl. 01.07 skrev Sean Owen:
>>
>> metrics -- Euclidean distance and Tanimoto coefficient -- that were
>> interesting enough that I implemented them today. So I think I've
>> covered chapter 3!
>
>
> https://issues.apache.org/jira/browse/MAHOUT-42
>
> I'm not quite happy with this implementation, suggestions appreciated.
>
>
>         karl
>

Reply via email to