Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Refining a 'vector space search'.

by TomDLux (Vicar)
on Jun 29, 2003 at 06:34 UTC ( [id://269967]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    v1 * w1 + v2 * w2 + v3 * w3 + ... + vn * wn
    
  2. or download this
      V * W
    ---------   = cos ( theta )
    ...
      VV * WW     VV * WW 
    ----------- = ------- = cos( theta )
    |VV| * |WW|    1 * 1
    
  3. or download this
    $v = [ 1, 4, 7, 10, 13,  16, 19, 22 ];
    $w = [ 1, 2, 4, 8, 16 ];
    
    ...
    my $dot_product = dot_prod( $v, $w ) or die( "dot_prod error" );;
    my $denom = (norm( $v ) * norm( $w );
    my $cos_theta = $denom ? $dot_product / $denom : 0;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://269967]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-04-23 17:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found