title: confused on fitting matrix or tf_idf
body: <p>So I have this dataframe <strong>df</strong>:</p>
  
  <pre><code>index
  0       horse horse horse Horse Rboe
  1       area Build extra ice line located Metro Overpass overpass passes track track viaduct work
  2       Better Crane Overpass site view work
  3       bench BUrdock dirt flower maniacs PATH southeast southeast southeast spring walk
  4       Bank beach meSH mesh mesh puddle puddle puddle south southeast southeast
  </code></pre>
  
  <p>and I wanted to cluster them with k-means. So I vectorize it first with TfidfVectorizer like this:</p>
  
  <pre><code>vec = TfidfVectorizer(
        lowercase = True,
        stop_words = 'english',
        use_idf=True
   )
  
  matrix = vec.fit_transform(df)
  </code></pre>
  
  <p>So far I have this term-document <strong>matrix</strong> and I turned it to dataframe <strong>idf_df</strong>:</p>
  
  <pre><code>idf_df = pd.DataFrame(matrix.toarray(), columns=vec.get_feature_names())
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/Nvw1q.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Nvw1q.jpg" alt="enter image description here"></a></p>
  
  <p>Now before I want to cluster them with K-Means, I need to look at the optimum <strong>k-cluster</strong> first using the <strong>KElbowVisualizer</strong>:</p>
  
  <pre><code>model = MiniBatchKMeans(MiniBatchKMeans(init_size=1024, batch_size=2048, random_state=20).fit(matrix).inertia_)
  visualizer = KElbowVisualizer(model,k=(2, 560), metric='silhouette', timings=False, size=(4080, 3720))
  visualizer.fit(matrix)        # Fit the data to the visualizer
  </code></pre>
  
  <p>But I'm confused <strong>what argument</strong> to insert in the function <strong>fit()</strong>??</p>
  
  <p>should I insert <strong>idf_df</strong>? but that does not make sense as it is dataframe. But when I insert <strong>matrix</strong> instead, the cluster would not make sense.</p>
  
  <p>Can someone please help me to understand this?</p>