title: scikit cosine_similarity vs pairwise_distances
body: <p>What is the difference between Scikit-learn's sklearn.metrics.pairwise.cosine_similarity and sklearn.metrics.pairwise.pairwise_distances(.. metric="cosine")?</p>
  
  <pre><code>from sklearn.feature_extraction.text import TfidfVectorizer
  
  documents = (
      "Macbook Pro 15' Silver Gray with Nvidia GPU",
      "Macbook GPU"    
  )
  
  tfidf_vectorizer = TfidfVectorizer()
  tfidf_matrix = tfidf_vectorizer.fit_transform(documents)
  
  from sklearn.metrics.pairwise import cosine_similarity
  print(cosine_similarity(tfidf_matrix[0:1], tfidf_matrix)[0,1])
  </code></pre>
  
  <p>0.37997836</p>
  
  <pre><code>from sklearn.metrics.pairwise import pairwise_distances
  print(pairwise_distances(tfidf_matrix[0:1], tfidf_matrix, metric='cosine')[0,1])
  </code></pre>
  
  <p>0.62002164</p>
  
  <p>Why are these different?</p>