title: How does kmeans know how to cluster documents when we only feed it tfidf vectors of individual words?
body: <p>I am using scikit learn's Kmeans algorithm to cluster comments. </p>
  
  <pre><code>sentence_list=['hello how are you', "I am doing great", "my name is abc"]
  
  vectorizer=TfidfVectorizer(min_df=1, max_df=0.9, stop_words='english', decode_error='ignore')
  vectorized=vectorizer.fit_transform(sentence_list)
  
  km=KMeans(n_clusters=num_clusters, init='k-means++',n_init=10, verbose=1)
  km.fit(vectorized)
  </code></pre>
  
  <p>when i print the output of vectorized, it gives me the index of the words and the tf-idf scores of the index. </p>
  
  <p>So im wondering, given we only get the tfidf scores of words, how is it that we manage to cluster documents based on individual words and not the score of an entire document? Or maybe it does this..Can someone explain to me the concept behind this?</p>