title: scikit-learn kmeans clustering overflow error
body: <p>While finding <strong>KMeans</strong> elbow, it showing overflow error</p>
  
  <pre><code>
  elbow=[]
  
  for i in range(30):
  
      model = KMeans(n_clusters=i)
      model.fit(feature_matrix)
      elbow.append(abs(model.score(feature_matrix)))
  </code></pre>
  
  <pre><code>/opt/conda/lib/python3.6/site-packages/sklearn/cluster/k_means_.py:90: RuntimeWarning: divide by zero encountered in log
    n_local_trials = 2 + int(np.log(n_clusters))
  </code></pre>
  
  <p>and it gives <code>overflow</code> error</p>