mahout-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sean Owen <sro...@gmail.com>
Subject Re: Clustering a large crawl
Date Thu, 31 May 2012 07:44:14 GMT
On Thu, May 31, 2012 at 12:36 AM, Pat Ferrel <pat@occamsmachete.com> wrote:

> I see
>    double denominator = Math.sqrt(lengthSquaredp1) *
> Math.sqrt(lengthSquaredp2);
>    // correct for floating-point rounding errors
>    if (denominator < dotProduct) {
>      denominator = dotProduct;
>    }
>    return 1.0 - dotProduct / denominator;
>
> So this is going to return 1 - cosine, right? So for clustering the
> distance 1 = very close, 0 = very far.
>
>
When two vectors are close, the angle between them is small, so the cosine
is large, near 1. 0 = close, 1 = far, as expected.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message