title: How to implement Jaccard index in Java or JSP?
body: <p>I have this problem in calculating Jaccard Similarity for finding similar books using transaction id from MySQL database of sales transactions :</p>
  
  <p>t1= Java,Ruby,C</p>
  
  <p>t2= Java,C#, Python</p>
  
  <p>t3= C#, VB, C </p>
  
  <p>....etc</p>
  
  <p>Size of Java intersection = 2; (How could we find it out?)</p>
  
  <p>Size of union = 3, (How could we find it out?)</p>
  
  <p>Jaccard similarity = (intersection/union) = 2/3</p>
  
  <p>But I don't understand how could I find out the "intersection" and "union" of the two vectors or how to implement it in Java/JSP.</p>
  
  <p>Please help me and thanks a lot!</p>