title: Cosine similarity of word2vec more than 1
body: <p>I used a word2vec algorithm of spark to compute documents vector of a text. </p>
  
  <p>I then used the <code>findSynonyms</code> function of the model object to get synonyms of few words. </p>
  
  <p>I see something like this: </p>
  
  <pre><code>w2vmodel.findSynonyms('science',4).show(5)
  +------------+------------------+
  |        word|        similarity|
  +------------+------------------+
  |     physics| 1.714908638833209|
  |     fiction|1.5189824643358183|
  |neuroscience|1.4968051528391833|
  |  psychology| 1.458865636374223|
  +------------+------------------+
  </code></pre>
  
  <p>I do not understand why the cosine similarity is being calculated as more than 1. Cosine similarity should be between 0 and 1 or max -1 and +1 (taking negative angles). </p>
  
  <p>Why it is more than 1 here? What's going wrong here?</p>