Conversion java.util vectors into sspace.vector.Vector

6 views
Skip to first unread message

samiabenabda...@gmail.com

unread,
Oct 8, 2015, 3:48:26 PM10/8/15
to S-Space Package Users
Hi Sirs,
I would like to calculate similarities between vectors having the type of java.util.Vector.

When using the class Similarity of sspace, there are problems with this type; even Cast doesn't resolve the problem;

Would you please say to me How to resolve this problem, ?

David Jurgens

unread,
Oct 8, 2015, 3:50:03 PM10/8/15
to s-spac...@googlegroups.com
Hi,

  The java.util.Vector data structure is more like a list for objects, rather than a numeric vector.  When you are trying to compare your java.util.Vector instances, what is in the lists?

  Thanks,
  David

--

---
You received this message because you are subscribed to the Google Groups "S-Space Package Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to s-space-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

samiabenabda...@gmail.com

unread,
Oct 8, 2015, 4:34:37 PM10/8/15
to S-Space Package Users, samiabenabda...@gmail.com
Hi Sir,
Thanks for your response, Vectors contain terms (String) wheighted with tf-idf for some ones, or weight as (1/N) for other ones;

David Jurgens

unread,
Oct 8, 2015, 4:59:57 PM10/8/15
to s-spac...@googlegroups.com, samiabenabda...@gmail.com
I think the easiest way would be to create two double[] arrays from the tf-idf scores in the java.util.Vector instances and then compare those with the Similarity class.

 Thanks,
 David

--

samiabenabda...@gmail.com

unread,
Oct 8, 2015, 5:09:31 PM10/8/15
to S-Space Package Users, samiabenabda...@gmail.com
Each element of the list in the vector is composed of both String and double value (score);


Le jeudi 8 octobre 2015 21:48:26 UTC+2, samiabenabda...@gmail.com a écrit :

David Jurgens

unread,
Oct 8, 2015, 5:10:22 PM10/8/15
to s-spac...@googlegroups.com, samiabenabda...@gmail.com
You should just use the double value then.

--

samiabenabda...@gmail.com

unread,
Oct 8, 2015, 5:13:56 PM10/8/15
to S-Space Package Users, samiabenabda...@gmail.com
Ok Sir, I'll try this;

Thank you very much


Le jeudi 8 octobre 2015 21:48:26 UTC+2, samiabenabda...@gmail.com a écrit :
Reply all
Reply to author
Forward
0 new messages