in reply to Re: Re: Refining a 'vector space search'.
in thread Refining a 'vector space search'.
You can get away with a sparse representation of the vector, i.e. you can keep just the positions of the elements of the vector that are nonzero. Say the vector looks like:
than you can encode it by a list containing just:(0, 1, 0, 0, 0, 1, 0, 0, 1, 0)
This can be a huge space saver if the vector is really large. It is very easy to calculate the cosine between vectors in that representation: just count the number of common elements in the lists and divide by the square root of product of the length of each of the two lists.( 1, 5, 8 )
Hope this helps, gjb


Replies are listed 'Best First'.  

Re: Re: Re: Re: Refining a 'vector space search'.
by Seumas (Curate) on Jun 28, 2003 at 18:56 UTC  
by gjb (Vicar) on Jun 28, 2003 at 19:45 UTC 
In Section
Seekers of Perl Wisdom